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