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 19 import android.content.pm.ParceledListSlice; 20 import android.graphics.Point; 21 import android.hardware.display.BrightnessConfiguration; 22 import android.hardware.display.Curve; 23 import android.hardware.display.IDisplayManagerCallback; 24 import android.hardware.display.IVirtualDisplayCallback; 25 import android.hardware.display.WifiDisplay; 26 import android.hardware.display.WifiDisplayStatus; 27 import android.media.projection.IMediaProjection; 28 import android.view.DisplayInfo; 29 import android.view.Surface; 30 31 /** @hide */ 32 interface IDisplayManager { getDisplayInfo(int displayId)33 DisplayInfo getDisplayInfo(int displayId); getDisplayIds()34 int[] getDisplayIds(); 35 registerCallback(in IDisplayManagerCallback callback)36 void registerCallback(in IDisplayManagerCallback callback); 37 38 // Requires CONFIGURE_WIFI_DISPLAY permission. 39 // The process must have previously registered a callback. startWifiDisplayScan()40 void startWifiDisplayScan(); 41 42 // Requires CONFIGURE_WIFI_DISPLAY permission. stopWifiDisplayScan()43 void stopWifiDisplayScan(); 44 45 // Requires CONFIGURE_WIFI_DISPLAY permission. connectWifiDisplay(String address)46 void connectWifiDisplay(String address); 47 48 // No permissions required. disconnectWifiDisplay()49 void disconnectWifiDisplay(); 50 51 // Requires CONFIGURE_WIFI_DISPLAY permission. renameWifiDisplay(String address, String alias)52 void renameWifiDisplay(String address, String alias); 53 54 // Requires CONFIGURE_WIFI_DISPLAY permission. forgetWifiDisplay(String address)55 void forgetWifiDisplay(String address); 56 57 // Requires CONFIGURE_WIFI_DISPLAY permission. pauseWifiDisplay()58 void pauseWifiDisplay(); 59 60 // Requires CONFIGURE_WIFI_DISPLAY permission. resumeWifiDisplay()61 void resumeWifiDisplay(); 62 63 // No permissions required. getWifiDisplayStatus()64 WifiDisplayStatus getWifiDisplayStatus(); 65 66 // Requires CONFIGURE_DISPLAY_COLOR_MODE requestColorMode(int displayId, int colorMode)67 void requestColorMode(int displayId, int colorMode); 68 69 // Requires CONTROL_DISPLAY_SATURATION setSaturationLevel(float level)70 void setSaturationLevel(float level); 71 72 // Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate 73 // MediaProjection token for certain combinations of flags. createVirtualDisplay(in IVirtualDisplayCallback callback, in IMediaProjection projectionToken, String packageName, String name, int width, int height, int densityDpi, in Surface surface, int flags, String uniqueId)74 int createVirtualDisplay(in IVirtualDisplayCallback callback, 75 in IMediaProjection projectionToken, String packageName, String name, 76 int width, int height, int densityDpi, in Surface surface, int flags, String uniqueId); 77 78 // No permissions required, but must be same Uid as the creator. resizeVirtualDisplay(in IVirtualDisplayCallback token, int width, int height, int densityDpi)79 void resizeVirtualDisplay(in IVirtualDisplayCallback token, 80 int width, int height, int densityDpi); 81 82 // No permissions required but must be same Uid as the creator. setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface)83 void setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface); 84 85 // No permissions required but must be same Uid as the creator. releaseVirtualDisplay(in IVirtualDisplayCallback token)86 void releaseVirtualDisplay(in IVirtualDisplayCallback token); 87 88 // Get a stable metric for the device's display size. No permissions required. getStableDisplaySize()89 Point getStableDisplaySize(); 90 91 // Requires BRIGHTNESS_SLIDER_USAGE permission. getBrightnessEvents(String callingPackage)92 ParceledListSlice getBrightnessEvents(String callingPackage); 93 94 // Requires ACCESS_AMBIENT_LIGHT_STATS permission. getAmbientBrightnessStats()95 ParceledListSlice getAmbientBrightnessStats(); 96 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. setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId, String packageName)100 void setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId, 101 String packageName); 102 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. getBrightnessConfigurationForUser(int userId)106 BrightnessConfiguration getBrightnessConfigurationForUser(int userId); 107 108 // Gets the default brightness configuration if configured. getDefaultBrightnessConfiguration()109 BrightnessConfiguration getDefaultBrightnessConfiguration(); 110 111 // Temporarily sets the display brightness. setTemporaryBrightness(int brightness)112 void setTemporaryBrightness(int brightness); 113 114 // Temporarily sets the auto brightness adjustment factor. setTemporaryAutoBrightnessAdjustment(float adjustment)115 void setTemporaryAutoBrightnessAdjustment(float adjustment); 116 117 // Get the minimum brightness curve. getMinimumBrightnessCurve()118 Curve getMinimumBrightnessCurve(); 119 } 120