IDisplayManager.aidl revision 122df868919f3e2b9a92d6e9dc66808884f3f080
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.content.pm.ParceledListSlice;
20import android.graphics.Point;
21import android.hardware.display.BrightnessConfiguration;
22import android.hardware.display.Curve;
23import android.hardware.display.IDisplayManagerCallback;
24import android.hardware.display.IVirtualDisplayCallback;
25import android.hardware.display.WifiDisplay;
26import android.hardware.display.WifiDisplayStatus;
27import android.media.projection.IMediaProjection;
28import android.view.DisplayInfo;
29import android.view.Surface;
30
31/** @hide */
32interface IDisplayManager {
33    DisplayInfo getDisplayInfo(int displayId);
34    int[] getDisplayIds();
35
36    void registerCallback(in IDisplayManagerCallback callback);
37
38    // Requires CONFIGURE_WIFI_DISPLAY permission.
39    // The process must have previously registered a callback.
40    void startWifiDisplayScan();
41
42    // Requires CONFIGURE_WIFI_DISPLAY permission.
43    void stopWifiDisplayScan();
44
45    // Requires CONFIGURE_WIFI_DISPLAY permission.
46    void connectWifiDisplay(String address);
47
48    // No permissions required.
49    void disconnectWifiDisplay();
50
51    // Requires CONFIGURE_WIFI_DISPLAY permission.
52    void renameWifiDisplay(String address, String alias);
53
54    // Requires CONFIGURE_WIFI_DISPLAY permission.
55    void forgetWifiDisplay(String address);
56
57    // Requires CONFIGURE_WIFI_DISPLAY permission.
58    void pauseWifiDisplay();
59
60    // Requires CONFIGURE_WIFI_DISPLAY permission.
61    void resumeWifiDisplay();
62
63    // No permissions required.
64    WifiDisplayStatus getWifiDisplayStatus();
65
66    // Requires CONFIGURE_DISPLAY_COLOR_MODE
67    void requestColorMode(int displayId, int colorMode);
68
69    // Requires CONTROL_DISPLAY_SATURATION
70    void setSaturationLevel(float level);
71
72    // Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate
73    // MediaProjection token for certain combinations of flags.
74    int createVirtualDisplay(in IVirtualDisplayCallback callback,
75            in IMediaProjection projectionToken, String packageName, String name,
76            int width, int height, int densityDpi, in Surface surface, int flags, String uniqueId);
77
78    // No permissions required, but must be same Uid as the creator.
79    void resizeVirtualDisplay(in IVirtualDisplayCallback token,
80            int width, int height, int densityDpi);
81
82    // No permissions required but must be same Uid as the creator.
83    void setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface);
84
85    // No permissions required but must be same Uid as the creator.
86    void releaseVirtualDisplay(in IVirtualDisplayCallback token);
87
88    // Get a stable metric for the device's display size. No permissions required.
89    Point getStableDisplaySize();
90
91    // Requires BRIGHTNESS_SLIDER_USAGE permission.
92    ParceledListSlice getBrightnessEvents(String callingPackage);
93
94    // Requires ACCESS_AMBIENT_LIGHT_STATS permission.
95    ParceledListSlice getAmbientBrightnessStats();
96
97    // Sets the global brightness configuration for a given user. Requires
98    // CONFIGURE_DISPLAY_BRIGHTNESS, and INTERACT_ACROSS_USER if the user being configured is not
99    // the same as the calling user.
100    void setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId,
101            String packageName);
102
103    // Gets the global brightness configuration for a given user. Requires
104    // CONFIGURE_DISPLAY_BRIGHTNESS, and INTERACT_ACROSS_USER if the user is not
105    // the same as the calling user.
106    BrightnessConfiguration getBrightnessConfigurationForUser(int userId);
107
108    // Gets the default brightness configuration if configured.
109    BrightnessConfiguration getDefaultBrightnessConfiguration();
110
111    // Temporarily sets the display brightness.
112    void setTemporaryBrightness(int brightness);
113
114    // Temporarily sets the auto brightness adjustment factor.
115    void setTemporaryAutoBrightnessAdjustment(float adjustment);
116
117    // Get the minimum brightness curve.
118    Curve getMinimumBrightnessCurve();
119}
120