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.VirtualDisplayConfig; 26 import android.hardware.display.WifiDisplay; 27 import android.hardware.display.WifiDisplayStatus; 28 import android.media.projection.IMediaProjection; 29 import android.view.DisplayInfo; 30 import android.view.Surface; 31 32 /** @hide */ 33 interface IDisplayManager { 34 @UnsupportedAppUsage getDisplayInfo(int displayId)35 DisplayInfo getDisplayInfo(int displayId); getDisplayIds()36 int[] getDisplayIds(); 37 isUidPresentOnDisplay(int uid, int displayId)38 boolean isUidPresentOnDisplay(int uid, int displayId); 39 registerCallback(in IDisplayManagerCallback callback)40 void registerCallback(in IDisplayManagerCallback callback); 41 42 // Requires CONFIGURE_WIFI_DISPLAY permission. 43 // The process must have previously registered a callback. startWifiDisplayScan()44 void startWifiDisplayScan(); 45 46 // Requires CONFIGURE_WIFI_DISPLAY permission. stopWifiDisplayScan()47 void stopWifiDisplayScan(); 48 49 // Requires CONFIGURE_WIFI_DISPLAY permission. connectWifiDisplay(String address)50 void connectWifiDisplay(String address); 51 52 // No permissions required. disconnectWifiDisplay()53 void disconnectWifiDisplay(); 54 55 // Requires CONFIGURE_WIFI_DISPLAY permission. renameWifiDisplay(String address, String alias)56 void renameWifiDisplay(String address, String alias); 57 58 // Requires CONFIGURE_WIFI_DISPLAY permission. forgetWifiDisplay(String address)59 void forgetWifiDisplay(String address); 60 61 // Requires CONFIGURE_WIFI_DISPLAY permission. pauseWifiDisplay()62 void pauseWifiDisplay(); 63 64 // Requires CONFIGURE_WIFI_DISPLAY permission. resumeWifiDisplay()65 void resumeWifiDisplay(); 66 67 // No permissions required. getWifiDisplayStatus()68 WifiDisplayStatus getWifiDisplayStatus(); 69 70 // Requires CONFIGURE_DISPLAY_COLOR_MODE requestColorMode(int displayId, int colorMode)71 void requestColorMode(int displayId, int colorMode); 72 73 // Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate 74 // MediaProjection token for certain combinations of flags. createVirtualDisplay(in VirtualDisplayConfig virtualDisplayConfig, in IVirtualDisplayCallback callback, in IMediaProjection projectionToken, String packageName)75 int createVirtualDisplay(in VirtualDisplayConfig virtualDisplayConfig, 76 in IVirtualDisplayCallback callback, in IMediaProjection projectionToken, 77 String packageName); 78 79 // No permissions required, but must be same Uid as the creator. resizeVirtualDisplay(in IVirtualDisplayCallback token, int width, int height, int densityDpi)80 void resizeVirtualDisplay(in IVirtualDisplayCallback token, 81 int width, int height, int densityDpi); 82 83 // No permissions required but must be same Uid as the creator. setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface)84 void setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface); 85 86 // No permissions required but must be same Uid as the creator. releaseVirtualDisplay(in IVirtualDisplayCallback token)87 void releaseVirtualDisplay(in IVirtualDisplayCallback token); 88 89 // No permissions required but must be same Uid as the creator. setVirtualDisplayState(in IVirtualDisplayCallback token, boolean isOn)90 void setVirtualDisplayState(in IVirtualDisplayCallback token, boolean isOn); 91 92 // Get a stable metric for the device's display size. No permissions required. getStableDisplaySize()93 Point getStableDisplaySize(); 94 95 // Requires BRIGHTNESS_SLIDER_USAGE permission. getBrightnessEvents(String callingPackage)96 ParceledListSlice getBrightnessEvents(String callingPackage); 97 98 // Requires ACCESS_AMBIENT_LIGHT_STATS permission. getAmbientBrightnessStats()99 ParceledListSlice getAmbientBrightnessStats(); 100 101 // Sets the global brightness configuration for a given user. Requires 102 // CONFIGURE_DISPLAY_BRIGHTNESS, and INTERACT_ACROSS_USER if the user being configured is not 103 // the same as the calling user. setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId, String packageName)104 void setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId, 105 String packageName); 106 107 // Gets the global brightness configuration for a given user. Requires 108 // CONFIGURE_DISPLAY_BRIGHTNESS, and INTERACT_ACROSS_USER if the user is not 109 // the same as the calling user. getBrightnessConfigurationForUser(int userId)110 BrightnessConfiguration getBrightnessConfigurationForUser(int userId); 111 112 // Gets the default brightness configuration if configured. getDefaultBrightnessConfiguration()113 BrightnessConfiguration getDefaultBrightnessConfiguration(); 114 115 // Gets the last requested minimal post processing settings for display with displayId. isMinimalPostProcessingRequested(int displayId)116 boolean isMinimalPostProcessingRequested(int displayId); 117 118 // Temporarily sets the display brightness. setTemporaryBrightness(float brightness)119 void setTemporaryBrightness(float brightness); 120 121 // Temporarily sets the auto brightness adjustment factor. setTemporaryAutoBrightnessAdjustment(float adjustment)122 void setTemporaryAutoBrightnessAdjustment(float adjustment); 123 124 // Get the minimum brightness curve. getMinimumBrightnessCurve()125 Curve getMinimumBrightnessCurve(); 126 127 // Gets the id of the preferred wide gamut color space for all displays. 128 // The wide gamut color space is returned from composition pipeline 129 // based on hardware capability. getPreferredWideGamutColorSpaceId()130 int getPreferredWideGamutColorSpaceId(); 131 } 132