blob: 13599cfa0b7d58495b3e9b53220727ab5aaed3d9 [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;
Jeff Brownbd6e1502012-08-28 03:27:37 -070022import android.hardware.display.IDisplayManagerCallback;
Michael Wright75ee9fc2014-09-01 19:55:22 -070023import android.hardware.display.IVirtualDisplayCallback;
Jeff Browne08ae382012-09-07 20:36:36 -070024import android.hardware.display.WifiDisplay;
25import android.hardware.display.WifiDisplayStatus;
Michael Wrightc39d47a2014-07-08 18:07:36 -070026import android.media.projection.IMediaProjection;
Jeff Brownfa25bf52012-07-23 19:26:30 -070027import android.view.DisplayInfo;
Jeff Browna506a6e2013-06-04 00:02:38 -070028import android.view.Surface;
Jeff Brownfa25bf52012-07-23 19:26:30 -070029
30/** @hide */
31interface IDisplayManager {
Jeff Brownbd6e1502012-08-28 03:27:37 -070032 DisplayInfo getDisplayInfo(int displayId);
33 int[] getDisplayIds();
34
35 void registerCallback(in IDisplayManagerCallback callback);
Jeff Browne08ae382012-09-07 20:36:36 -070036
Jeff Brownce468a32013-11-21 16:42:03 -080037 // Requires CONFIGURE_WIFI_DISPLAY permission.
38 // The process must have previously registered a callback.
39 void startWifiDisplayScan();
Jeff Browne08ae382012-09-07 20:36:36 -070040
Jeff Brownce468a32013-11-21 16:42:03 -080041 // Requires CONFIGURE_WIFI_DISPLAY permission.
42 void stopWifiDisplayScan();
43
44 // Requires CONFIGURE_WIFI_DISPLAY permission.
Jeff Browne08ae382012-09-07 20:36:36 -070045 void connectWifiDisplay(String address);
46
Jeff Brownbc335452012-09-26 18:34:47 -070047 // No permissions required.
Jeff Browne08ae382012-09-07 20:36:36 -070048 void disconnectWifiDisplay();
49
50 // Requires CONFIGURE_WIFI_DISPLAY permission.
Jeff Brown89d55462012-09-19 11:33:42 -070051 void renameWifiDisplay(String address, String alias);
52
53 // Requires CONFIGURE_WIFI_DISPLAY permission.
54 void forgetWifiDisplay(String address);
55
Jeff Brownce468a32013-11-21 16:42:03 -080056 // Requires CONFIGURE_WIFI_DISPLAY permission.
57 void pauseWifiDisplay();
58
59 // Requires CONFIGURE_WIFI_DISPLAY permission.
60 void resumeWifiDisplay();
61
Jeff Brownbc335452012-09-26 18:34:47 -070062 // No permissions required.
Jeff Browne08ae382012-09-07 20:36:36 -070063 WifiDisplayStatus getWifiDisplayStatus();
Jeff Browna506a6e2013-06-04 00:02:38 -070064
Michael Wright1c9977b2016-07-12 13:30:10 -070065 // Requires CONFIGURE_DISPLAY_COLOR_MODE
66 void requestColorMode(int displayId, int colorMode);
Michael Wright58e829f2015-09-15 00:13:26 +010067
Michael Wrightc39d47a2014-07-08 18:07:36 -070068 // Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate
69 // MediaProjection token for certain combinations of flags.
Michael Wright75ee9fc2014-09-01 19:55:22 -070070 int createVirtualDisplay(in IVirtualDisplayCallback callback,
Michael Wrightc39d47a2014-07-08 18:07:36 -070071 in IMediaProjection projectionToken, String packageName, String name,
Santos Cordonee8931e2017-04-05 10:31:15 -070072 int width, int height, int densityDpi, in Surface surface, int flags, String uniqueId);
Jeff Browna506a6e2013-06-04 00:02:38 -070073
Michael Wright01e840f2014-06-26 16:03:25 -070074 // No permissions required, but must be same Uid as the creator.
Michael Wright75ee9fc2014-09-01 19:55:22 -070075 void resizeVirtualDisplay(in IVirtualDisplayCallback token,
Michael Wright01e840f2014-06-26 16:03:25 -070076 int width, int height, int densityDpi);
77
Jeff Browna506a6e2013-06-04 00:02:38 -070078 // No permissions required but must be same Uid as the creator.
Michael Wright75ee9fc2014-09-01 19:55:22 -070079 void setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface);
Jeff Brown92207df2014-04-16 13:16:07 -070080
81 // No permissions required but must be same Uid as the creator.
Michael Wright75ee9fc2014-09-01 19:55:22 -070082 void releaseVirtualDisplay(in IVirtualDisplayCallback token);
Michael Wrighteedcbf12017-08-16 23:14:54 +010083
84 // Get a stable metric for the device's display size. No permissions required.
85 Point getStableDisplaySize();
Kenny Guy22bd0442017-10-26 00:15:54 +010086
87 // Requires BRIGHTNESS_SLIDER_USAGE permission.
Kenny Guy29aa30e2017-11-30 13:43:46 +000088 ParceledListSlice getBrightnessEvents(String callingPackage);
Kenny Guy22bd0442017-10-26 00:15:54 +010089
Michael Wrighteef0e132017-11-21 17:57:52 +000090 // Sets the global brightness configuration for a given user. Requires
91 // CONFIGURE_DISPLAY_BRIGHTNESS, and INTERACT_ACROSS_USER if the user being configured is not
92 // the same as the calling user.
Kenny Guy05ce8092018-01-17 13:44:20 +000093 void setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId,
94 String packageName);
Michael Wrightd8460232018-01-16 18:04:59 +000095
96 // Temporarily sets the display brightness.
97 void setTemporaryBrightness(int brightness);
98
99 // Temporarily sets the auto brightness adjustment factor.
100 void setTemporaryAutoBrightnessAdjustment(float adjustment);
Jeff Brownfa25bf52012-07-23 19:26:30 -0700101}