Jeff Brown | fa25bf5 | 2012-07-23 19:26:30 -0700 | [diff] [blame] | 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 | |
| 17 | package android.hardware.display; |
| 18 | |
Kenny Guy | 22bd044 | 2017-10-26 00:15:54 +0100 | [diff] [blame] | 19 | import android.content.pm.ParceledListSlice; |
Michael Wright | eedcbf1 | 2017-08-16 23:14:54 +0100 | [diff] [blame] | 20 | import android.graphics.Point; |
Michael Wright | eef0e13 | 2017-11-21 17:57:52 +0000 | [diff] [blame] | 21 | import android.hardware.display.BrightnessConfiguration; |
Dan Gittik | 122df86 | 2018-03-28 16:59:22 +0100 | [diff] [blame] | 22 | import android.hardware.display.Curve; |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 23 | import android.hardware.display.IDisplayManagerCallback; |
Michael Wright | 75ee9fc | 2014-09-01 19:55:22 -0700 | [diff] [blame] | 24 | import android.hardware.display.IVirtualDisplayCallback; |
Jeff Brown | e08ae38 | 2012-09-07 20:36:36 -0700 | [diff] [blame] | 25 | import android.hardware.display.WifiDisplay; |
| 26 | import android.hardware.display.WifiDisplayStatus; |
Michael Wright | c39d47a | 2014-07-08 18:07:36 -0700 | [diff] [blame] | 27 | import android.media.projection.IMediaProjection; |
Jeff Brown | fa25bf5 | 2012-07-23 19:26:30 -0700 | [diff] [blame] | 28 | import android.view.DisplayInfo; |
Jeff Brown | a506a6e | 2013-06-04 00:02:38 -0700 | [diff] [blame] | 29 | import android.view.Surface; |
Jeff Brown | fa25bf5 | 2012-07-23 19:26:30 -0700 | [diff] [blame] | 30 | |
| 31 | /** @hide */ |
| 32 | interface IDisplayManager { |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 33 | DisplayInfo getDisplayInfo(int displayId); |
| 34 | int[] getDisplayIds(); |
| 35 | |
| 36 | void registerCallback(in IDisplayManagerCallback callback); |
Jeff Brown | e08ae38 | 2012-09-07 20:36:36 -0700 | [diff] [blame] | 37 | |
Jeff Brown | ce468a3 | 2013-11-21 16:42:03 -0800 | [diff] [blame] | 38 | // Requires CONFIGURE_WIFI_DISPLAY permission. |
| 39 | // The process must have previously registered a callback. |
| 40 | void startWifiDisplayScan(); |
Jeff Brown | e08ae38 | 2012-09-07 20:36:36 -0700 | [diff] [blame] | 41 | |
Jeff Brown | ce468a3 | 2013-11-21 16:42:03 -0800 | [diff] [blame] | 42 | // Requires CONFIGURE_WIFI_DISPLAY permission. |
| 43 | void stopWifiDisplayScan(); |
| 44 | |
| 45 | // Requires CONFIGURE_WIFI_DISPLAY permission. |
Jeff Brown | e08ae38 | 2012-09-07 20:36:36 -0700 | [diff] [blame] | 46 | void connectWifiDisplay(String address); |
| 47 | |
Jeff Brown | bc33545 | 2012-09-26 18:34:47 -0700 | [diff] [blame] | 48 | // No permissions required. |
Jeff Brown | e08ae38 | 2012-09-07 20:36:36 -0700 | [diff] [blame] | 49 | void disconnectWifiDisplay(); |
| 50 | |
| 51 | // Requires CONFIGURE_WIFI_DISPLAY permission. |
Jeff Brown | 89d5546 | 2012-09-19 11:33:42 -0700 | [diff] [blame] | 52 | void renameWifiDisplay(String address, String alias); |
| 53 | |
| 54 | // Requires CONFIGURE_WIFI_DISPLAY permission. |
| 55 | void forgetWifiDisplay(String address); |
| 56 | |
Jeff Brown | ce468a3 | 2013-11-21 16:42:03 -0800 | [diff] [blame] | 57 | // Requires CONFIGURE_WIFI_DISPLAY permission. |
| 58 | void pauseWifiDisplay(); |
| 59 | |
| 60 | // Requires CONFIGURE_WIFI_DISPLAY permission. |
| 61 | void resumeWifiDisplay(); |
| 62 | |
Jeff Brown | bc33545 | 2012-09-26 18:34:47 -0700 | [diff] [blame] | 63 | // No permissions required. |
Jeff Brown | e08ae38 | 2012-09-07 20:36:36 -0700 | [diff] [blame] | 64 | WifiDisplayStatus getWifiDisplayStatus(); |
Jeff Brown | a506a6e | 2013-06-04 00:02:38 -0700 | [diff] [blame] | 65 | |
Michael Wright | 1c9977b | 2016-07-12 13:30:10 -0700 | [diff] [blame] | 66 | // Requires CONFIGURE_DISPLAY_COLOR_MODE |
| 67 | void requestColorMode(int displayId, int colorMode); |
Michael Wright | 58e829f | 2015-09-15 00:13:26 +0100 | [diff] [blame] | 68 | |
Michael Wright | c39d47a | 2014-07-08 18:07:36 -0700 | [diff] [blame] | 69 | // Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate |
| 70 | // MediaProjection token for certain combinations of flags. |
Michael Wright | 75ee9fc | 2014-09-01 19:55:22 -0700 | [diff] [blame] | 71 | int createVirtualDisplay(in IVirtualDisplayCallback callback, |
Michael Wright | c39d47a | 2014-07-08 18:07:36 -0700 | [diff] [blame] | 72 | in IMediaProjection projectionToken, String packageName, String name, |
Santos Cordon | ee8931e | 2017-04-05 10:31:15 -0700 | [diff] [blame] | 73 | int width, int height, int densityDpi, in Surface surface, int flags, String uniqueId); |
Jeff Brown | a506a6e | 2013-06-04 00:02:38 -0700 | [diff] [blame] | 74 | |
Michael Wright | 01e840f | 2014-06-26 16:03:25 -0700 | [diff] [blame] | 75 | // No permissions required, but must be same Uid as the creator. |
Michael Wright | 75ee9fc | 2014-09-01 19:55:22 -0700 | [diff] [blame] | 76 | void resizeVirtualDisplay(in IVirtualDisplayCallback token, |
Michael Wright | 01e840f | 2014-06-26 16:03:25 -0700 | [diff] [blame] | 77 | int width, int height, int densityDpi); |
| 78 | |
Jeff Brown | a506a6e | 2013-06-04 00:02:38 -0700 | [diff] [blame] | 79 | // No permissions required but must be same Uid as the creator. |
Michael Wright | 75ee9fc | 2014-09-01 19:55:22 -0700 | [diff] [blame] | 80 | void setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface); |
Jeff Brown | 92207df | 2014-04-16 13:16:07 -0700 | [diff] [blame] | 81 | |
| 82 | // No permissions required but must be same Uid as the creator. |
Michael Wright | 75ee9fc | 2014-09-01 19:55:22 -0700 | [diff] [blame] | 83 | void releaseVirtualDisplay(in IVirtualDisplayCallback token); |
Michael Wright | eedcbf1 | 2017-08-16 23:14:54 +0100 | [diff] [blame] | 84 | |
chaviw | da4c694 | 2018-11-07 15:52:56 -0800 | [diff] [blame] | 85 | // No permissions required but must be same Uid as the creator. |
| 86 | void setVirtualDisplayState(in IVirtualDisplayCallback token, boolean isOn); |
| 87 | |
Michael Wright | eedcbf1 | 2017-08-16 23:14:54 +0100 | [diff] [blame] | 88 | // Get a stable metric for the device's display size. No permissions required. |
| 89 | Point getStableDisplaySize(); |
Kenny Guy | 22bd044 | 2017-10-26 00:15:54 +0100 | [diff] [blame] | 90 | |
| 91 | // Requires BRIGHTNESS_SLIDER_USAGE permission. |
Kenny Guy | 29aa30e | 2017-11-30 13:43:46 +0000 | [diff] [blame] | 92 | ParceledListSlice getBrightnessEvents(String callingPackage); |
Kenny Guy | 22bd044 | 2017-10-26 00:15:54 +0100 | [diff] [blame] | 93 | |
Peeyush Agarwal | cc155dd | 2018-01-10 11:51:33 +0000 | [diff] [blame] | 94 | // Requires ACCESS_AMBIENT_LIGHT_STATS permission. |
| 95 | ParceledListSlice getAmbientBrightnessStats(); |
| 96 | |
Michael Wright | eef0e13 | 2017-11-21 17:57:52 +0000 | [diff] [blame] | 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. |
Kenny Guy | 05ce809 | 2018-01-17 13:44:20 +0000 | [diff] [blame] | 100 | void setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId, |
| 101 | String packageName); |
Michael Wright | d846023 | 2018-01-16 18:04:59 +0000 | [diff] [blame] | 102 | |
Kenny Guy | 6d1009f | 2018-03-14 14:28:23 +0000 | [diff] [blame] | 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 | |
Michael Wright | d846023 | 2018-01-16 18:04:59 +0000 | [diff] [blame] | 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); |
Dan Gittik | 122df86 | 2018-03-28 16:59:22 +0100 | [diff] [blame] | 116 | |
| 117 | // Get the minimum brightness curve. |
| 118 | Curve getMinimumBrightnessCurve(); |
Peiyong Lin | 277eaff | 2019-01-16 16:18:22 -0800 | [diff] [blame^] | 119 | |
| 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 Brown | fa25bf5 | 2012-07-23 19:26:30 -0700 | [diff] [blame] | 124 | } |