1/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.display;
18
19import android.hardware.display.IDisplayManagerCallback;
20import android.hardware.display.IVirtualDisplayCallback;
21import android.hardware.display.WifiDisplay;
22import android.hardware.display.WifiDisplayStatus;
23import android.media.projection.IMediaProjection;
24import android.view.DisplayInfo;
25import android.view.Surface;
26
27/** @hide */
28interface IDisplayManager {
29    DisplayInfo getDisplayInfo(int displayId);
30    int[] getDisplayIds();
31
32    void registerCallback(in IDisplayManagerCallback callback);
33
34    // Requires CONFIGURE_WIFI_DISPLAY permission.
35    // The process must have previously registered a callback.
36    void startWifiDisplayScan();
37
38    // Requires CONFIGURE_WIFI_DISPLAY permission.
39    void stopWifiDisplayScan();
40
41    // Requires CONFIGURE_WIFI_DISPLAY permission.
42    void connectWifiDisplay(String address);
43
44    // No permissions required.
45    void disconnectWifiDisplay();
46
47    // Requires CONFIGURE_WIFI_DISPLAY permission.
48    void renameWifiDisplay(String address, String alias);
49
50    // Requires CONFIGURE_WIFI_DISPLAY permission.
51    void forgetWifiDisplay(String address);
52
53    // Requires CONFIGURE_WIFI_DISPLAY permission.
54    void pauseWifiDisplay();
55
56    // Requires CONFIGURE_WIFI_DISPLAY permission.
57    void resumeWifiDisplay();
58
59    // No permissions required.
60    WifiDisplayStatus getWifiDisplayStatus();
61
62    // Requires CONFIGURE_DISPLAY_COLOR_MODE
63    void requestColorMode(int displayId, int colorMode);
64
65    // Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate
66    // MediaProjection token for certain combinations of flags.
67    int createVirtualDisplay(in IVirtualDisplayCallback callback,
68            in IMediaProjection projectionToken, String packageName, String name,
69            int width, int height, int densityDpi, in Surface surface, int flags, String uniqueId);
70
71    // No permissions required, but must be same Uid as the creator.
72    void resizeVirtualDisplay(in IVirtualDisplayCallback token,
73            int width, int height, int densityDpi);
74
75    // No permissions required but must be same Uid as the creator.
76    void setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface);
77
78    // No permissions required but must be same Uid as the creator.
79    void releaseVirtualDisplay(in IVirtualDisplayCallback token);
80}
81