blob: 5ea8bd67ce756baa5d2ec3844904c4f17552f6d0 [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 {
Jeff Brownbd6e1502012-08-28 03:27:37 -070033 DisplayInfo getDisplayInfo(int displayId);
34 int[] getDisplayIds();
35
36 void registerCallback(in IDisplayManagerCallback callback);
Jeff Browne08ae382012-09-07 20:36:36 -070037
Jeff Brownce468a32013-11-21 16:42:03 -080038 // Requires CONFIGURE_WIFI_DISPLAY permission.
39 // The process must have previously registered a callback.
40 void startWifiDisplayScan();
Jeff Browne08ae382012-09-07 20:36:36 -070041
Jeff Brownce468a32013-11-21 16:42:03 -080042 // Requires CONFIGURE_WIFI_DISPLAY permission.
43 void stopWifiDisplayScan();
44
45 // Requires CONFIGURE_WIFI_DISPLAY permission.
Jeff Browne08ae382012-09-07 20:36:36 -070046 void connectWifiDisplay(String address);
47
Jeff Brownbc335452012-09-26 18:34:47 -070048 // No permissions required.
Jeff Browne08ae382012-09-07 20:36:36 -070049 void disconnectWifiDisplay();
50
51 // Requires CONFIGURE_WIFI_DISPLAY permission.
Jeff Brown89d55462012-09-19 11:33:42 -070052 void renameWifiDisplay(String address, String alias);
53
54 // Requires CONFIGURE_WIFI_DISPLAY permission.
55 void forgetWifiDisplay(String address);
56
Jeff Brownce468a32013-11-21 16:42:03 -080057 // Requires CONFIGURE_WIFI_DISPLAY permission.
58 void pauseWifiDisplay();
59
60 // Requires CONFIGURE_WIFI_DISPLAY permission.
61 void resumeWifiDisplay();
62
Jeff Brownbc335452012-09-26 18:34:47 -070063 // No permissions required.
Jeff Browne08ae382012-09-07 20:36:36 -070064 WifiDisplayStatus getWifiDisplayStatus();
Jeff Browna506a6e2013-06-04 00:02:38 -070065
Michael Wright1c9977b2016-07-12 13:30:10 -070066 // Requires CONFIGURE_DISPLAY_COLOR_MODE
67 void requestColorMode(int displayId, int colorMode);
Michael Wright58e829f2015-09-15 00:13:26 +010068
Michael Wrightc39d47a2014-07-08 18:07:36 -070069 // Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate
70 // MediaProjection token for certain combinations of flags.
Michael Wright75ee9fc2014-09-01 19:55:22 -070071 int createVirtualDisplay(in IVirtualDisplayCallback callback,
Michael Wrightc39d47a2014-07-08 18:07:36 -070072 in IMediaProjection projectionToken, String packageName, String name,
Santos Cordonee8931e2017-04-05 10:31:15 -070073 int width, int height, int densityDpi, in Surface surface, int flags, String uniqueId);
Jeff Browna506a6e2013-06-04 00:02:38 -070074
Michael Wright01e840f2014-06-26 16:03:25 -070075 // No permissions required, but must be same Uid as the creator.
Michael Wright75ee9fc2014-09-01 19:55:22 -070076 void resizeVirtualDisplay(in IVirtualDisplayCallback token,
Michael Wright01e840f2014-06-26 16:03:25 -070077 int width, int height, int densityDpi);
78
Jeff Browna506a6e2013-06-04 00:02:38 -070079 // No permissions required but must be same Uid as the creator.
Michael Wright75ee9fc2014-09-01 19:55:22 -070080 void setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface);
Jeff Brown92207df2014-04-16 13:16:07 -070081
82 // No permissions required but must be same Uid as the creator.
Michael Wright75ee9fc2014-09-01 19:55:22 -070083 void releaseVirtualDisplay(in IVirtualDisplayCallback token);
Michael Wrighteedcbf12017-08-16 23:14:54 +010084
chaviwda4c6942018-11-07 15:52:56 -080085 // No permissions required but must be same Uid as the creator.
86 void setVirtualDisplayState(in IVirtualDisplayCallback token, boolean isOn);
87
Michael Wrighteedcbf12017-08-16 23:14:54 +010088 // Get a stable metric for the device's display size. No permissions required.
89 Point getStableDisplaySize();
Kenny Guy22bd0442017-10-26 00:15:54 +010090
91 // Requires BRIGHTNESS_SLIDER_USAGE permission.
Kenny Guy29aa30e2017-11-30 13:43:46 +000092 ParceledListSlice getBrightnessEvents(String callingPackage);
Kenny Guy22bd0442017-10-26 00:15:54 +010093
Peeyush Agarwalcc155dd2018-01-10 11:51:33 +000094 // Requires ACCESS_AMBIENT_LIGHT_STATS permission.
95 ParceledListSlice getAmbientBrightnessStats();
96
Michael Wrighteef0e132017-11-21 17:57:52 +000097 // 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.
Kenny Guy05ce8092018-01-17 13:44:20 +0000100 void setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId,
101 String packageName);
Michael Wrightd8460232018-01-16 18:04:59 +0000102
Kenny Guy6d1009f2018-03-14 14:28:23 +0000103 // 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
Michael Wrightd8460232018-01-16 18:04:59 +0000111 // Temporarily sets the display brightness.
112 void setTemporaryBrightness(int brightness);
113
114 // Temporarily sets the auto brightness adjustment factor.
115 void setTemporaryAutoBrightnessAdjustment(float adjustment);
Dan Gittik122df862018-03-28 16:59:22 +0100116
117 // Get the minimum brightness curve.
118 Curve getMinimumBrightnessCurve();
Peiyong Lin277eaff2019-01-16 16:18:22 -0800119
120 // Gets the id of the preferred wide gamut color space for all displays.
121 // The wide gamut color space is returned from composition pipeline
122 // based on hardware capability.
123 int getPreferredWideGamutColorSpaceId();
Jeff Brownfa25bf52012-07-23 19:26:30 -0700124}