blob: 0143c9129b50cd16f702db67c72199094f880f72 [file] [log] [blame]
Jeff Brownfa25bf52012-07-23 19:26:30 -07001/*
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
Kenny Guy22bd0442017-10-26 00:15:54 +010019import android.content.pm.ParceledListSlice;
Michael Wrighteedcbf12017-08-16 23:14:54 +010020import android.graphics.Point;
Michael Wrighteef0e132017-11-21 17:57:52 +000021import android.hardware.display.BrightnessConfiguration;
Dan Gittik122df862018-03-28 16:59:22 +010022import android.hardware.display.Curve;
Jeff Brownbd6e1502012-08-28 03:27:37 -070023import android.hardware.display.IDisplayManagerCallback;
Michael Wright75ee9fc2014-09-01 19:55:22 -070024import android.hardware.display.IVirtualDisplayCallback;
Jeff Browne08ae382012-09-07 20:36:36 -070025import android.hardware.display.WifiDisplay;
26import android.hardware.display.WifiDisplayStatus;
Michael Wrightc39d47a2014-07-08 18:07:36 -070027import android.media.projection.IMediaProjection;
Jeff Brownfa25bf52012-07-23 19:26:30 -070028import android.view.DisplayInfo;
Jeff Browna506a6e2013-06-04 00:02:38 -070029import android.view.Surface;
Jeff Brownfa25bf52012-07-23 19:26:30 -070030
31/** @hide */
32interface IDisplayManager {
Andrei Oneada6e5702019-02-25 15:24:42 +000033 @UnsupportedAppUsage
Jeff Brownbd6e1502012-08-28 03:27:37 -070034 DisplayInfo getDisplayInfo(int displayId);
35 int[] getDisplayIds();
36
lumarkec75b422019-01-07 15:58:38 +080037 boolean isUidPresentOnDisplay(int uid, int displayId);
38
Jeff Brownbd6e1502012-08-28 03:27:37 -070039 void registerCallback(in IDisplayManagerCallback callback);
Jeff Browne08ae382012-09-07 20:36:36 -070040
Jeff Brownce468a32013-11-21 16:42:03 -080041 // Requires CONFIGURE_WIFI_DISPLAY permission.
42 // The process must have previously registered a callback.
43 void startWifiDisplayScan();
Jeff Browne08ae382012-09-07 20:36:36 -070044
Jeff Brownce468a32013-11-21 16:42:03 -080045 // Requires CONFIGURE_WIFI_DISPLAY permission.
46 void stopWifiDisplayScan();
47
48 // Requires CONFIGURE_WIFI_DISPLAY permission.
Jeff Browne08ae382012-09-07 20:36:36 -070049 void connectWifiDisplay(String address);
50
Jeff Brownbc335452012-09-26 18:34:47 -070051 // No permissions required.
Jeff Browne08ae382012-09-07 20:36:36 -070052 void disconnectWifiDisplay();
53
54 // Requires CONFIGURE_WIFI_DISPLAY permission.
Jeff Brown89d55462012-09-19 11:33:42 -070055 void renameWifiDisplay(String address, String alias);
56
57 // Requires CONFIGURE_WIFI_DISPLAY permission.
58 void forgetWifiDisplay(String address);
59
Jeff Brownce468a32013-11-21 16:42:03 -080060 // Requires CONFIGURE_WIFI_DISPLAY permission.
61 void pauseWifiDisplay();
62
63 // Requires CONFIGURE_WIFI_DISPLAY permission.
64 void resumeWifiDisplay();
65
Jeff Brownbc335452012-09-26 18:34:47 -070066 // No permissions required.
Jeff Browne08ae382012-09-07 20:36:36 -070067 WifiDisplayStatus getWifiDisplayStatus();
Jeff Browna506a6e2013-06-04 00:02:38 -070068
Michael Wright1c9977b2016-07-12 13:30:10 -070069 // Requires CONFIGURE_DISPLAY_COLOR_MODE
70 void requestColorMode(int displayId, int colorMode);
Michael Wright58e829f2015-09-15 00:13:26 +010071
Michael Wrightc39d47a2014-07-08 18:07:36 -070072 // Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate
73 // MediaProjection token for certain combinations of flags.
Michael Wright75ee9fc2014-09-01 19:55:22 -070074 int createVirtualDisplay(in IVirtualDisplayCallback callback,
Michael Wrightc39d47a2014-07-08 18:07:36 -070075 in IMediaProjection projectionToken, String packageName, String name,
Santos Cordonee8931e2017-04-05 10:31:15 -070076 int width, int height, int densityDpi, in Surface surface, int flags, String uniqueId);
Jeff Browna506a6e2013-06-04 00:02:38 -070077
Michael Wright01e840f2014-06-26 16:03:25 -070078 // No permissions required, but must be same Uid as the creator.
Michael Wright75ee9fc2014-09-01 19:55:22 -070079 void resizeVirtualDisplay(in IVirtualDisplayCallback token,
Michael Wright01e840f2014-06-26 16:03:25 -070080 int width, int height, int densityDpi);
81
Jeff Browna506a6e2013-06-04 00:02:38 -070082 // No permissions required but must be same Uid as the creator.
Michael Wright75ee9fc2014-09-01 19:55:22 -070083 void setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface);
Jeff Brown92207df2014-04-16 13:16:07 -070084
85 // No permissions required but must be same Uid as the creator.
Michael Wright75ee9fc2014-09-01 19:55:22 -070086 void releaseVirtualDisplay(in IVirtualDisplayCallback token);
Michael Wrighteedcbf12017-08-16 23:14:54 +010087
chaviwda4c6942018-11-07 15:52:56 -080088 // No permissions required but must be same Uid as the creator.
89 void setVirtualDisplayState(in IVirtualDisplayCallback token, boolean isOn);
90
Michael Wrighteedcbf12017-08-16 23:14:54 +010091 // Get a stable metric for the device's display size. No permissions required.
92 Point getStableDisplaySize();
Kenny Guy22bd0442017-10-26 00:15:54 +010093
94 // Requires BRIGHTNESS_SLIDER_USAGE permission.
Kenny Guy29aa30e2017-11-30 13:43:46 +000095 ParceledListSlice getBrightnessEvents(String callingPackage);
Kenny Guy22bd0442017-10-26 00:15:54 +010096
Peeyush Agarwalcc155dd2018-01-10 11:51:33 +000097 // Requires ACCESS_AMBIENT_LIGHT_STATS permission.
98 ParceledListSlice getAmbientBrightnessStats();
99
Michael Wrighteef0e132017-11-21 17:57:52 +0000100 // Sets the global brightness configuration for a given user. Requires
101 // CONFIGURE_DISPLAY_BRIGHTNESS, and INTERACT_ACROSS_USER if the user being configured is not
102 // the same as the calling user.
Kenny Guy05ce8092018-01-17 13:44:20 +0000103 void setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId,
104 String packageName);
Michael Wrightd8460232018-01-16 18:04:59 +0000105
Kenny Guy6d1009f2018-03-14 14:28:23 +0000106 // Gets the global brightness configuration for a given user. Requires
107 // CONFIGURE_DISPLAY_BRIGHTNESS, and INTERACT_ACROSS_USER if the user is not
108 // the same as the calling user.
109 BrightnessConfiguration getBrightnessConfigurationForUser(int userId);
110
111 // Gets the default brightness configuration if configured.
112 BrightnessConfiguration getDefaultBrightnessConfiguration();
113
Michael Wrightd8460232018-01-16 18:04:59 +0000114 // Temporarily sets the display brightness.
115 void setTemporaryBrightness(int brightness);
116
117 // Temporarily sets the auto brightness adjustment factor.
118 void setTemporaryAutoBrightnessAdjustment(float adjustment);
Dan Gittik122df862018-03-28 16:59:22 +0100119
120 // Get the minimum brightness curve.
121 Curve getMinimumBrightnessCurve();
Peiyong Lin277eaff2019-01-16 16:18:22 -0800122
123 // Gets the id of the preferred wide gamut color space for all displays.
124 // The wide gamut color space is returned from composition pipeline
125 // based on hardware capability.
126 int getPreferredWideGamutColorSpaceId();
Jeff Brownfa25bf52012-07-23 19:26:30 -0700127}