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 { 33 @UnsupportedAppUsage getDisplayInfo(int displayId)34 DisplayInfo getDisplayInfo(int displayId); getDisplayIds()35 int[] getDisplayIds(); 36 isUidPresentOnDisplay(int uid, int displayId)37 boolean isUidPresentOnDisplay(int uid, int displayId); 38 registerCallback(in IDisplayManagerCallback callback)39 void registerCallback(in IDisplayManagerCallback callback); 40 41 // Requires CONFIGURE_WIFI_DISPLAY permission. 42 // The process must have previously registered a callback. startWifiDisplayScan()43 void startWifiDisplayScan(); 44 45 // Requires CONFIGURE_WIFI_DISPLAY permission. stopWifiDisplayScan()46 void stopWifiDisplayScan(); 47 48 // Requires CONFIGURE_WIFI_DISPLAY permission. connectWifiDisplay(String address)49 void connectWifiDisplay(String address); 50 51 // No permissions required. disconnectWifiDisplay()52 void disconnectWifiDisplay(); 53 54 // Requires CONFIGURE_WIFI_DISPLAY permission. renameWifiDisplay(String address, String alias)55 void renameWifiDisplay(String address, String alias); 56 57 // Requires CONFIGURE_WIFI_DISPLAY permission. forgetWifiDisplay(String address)58 void forgetWifiDisplay(String address); 59 60 // Requires CONFIGURE_WIFI_DISPLAY permission. pauseWifiDisplay()61 void pauseWifiDisplay(); 62 63 // Requires CONFIGURE_WIFI_DISPLAY permission. resumeWifiDisplay()64 void resumeWifiDisplay(); 65 66 // No permissions required. getWifiDisplayStatus()67 WifiDisplayStatus getWifiDisplayStatus(); 68 69 // Requires CONFIGURE_DISPLAY_COLOR_MODE requestColorMode(int displayId, int colorMode)70 void requestColorMode(int displayId, int colorMode); 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 // No permissions required but must be same Uid as the creator. setVirtualDisplayState(in IVirtualDisplayCallback token, boolean isOn)89 void setVirtualDisplayState(in IVirtualDisplayCallback token, boolean isOn); 90 91 // Get a stable metric for the device's display size. No permissions required. getStableDisplaySize()92 Point getStableDisplaySize(); 93 94 // Requires BRIGHTNESS_SLIDER_USAGE permission. getBrightnessEvents(String callingPackage)95 ParceledListSlice getBrightnessEvents(String callingPackage); 96 97 // Requires ACCESS_AMBIENT_LIGHT_STATS permission. getAmbientBrightnessStats()98 ParceledListSlice getAmbientBrightnessStats(); 99 100 // Sets the global brightness configuration for a given user. Requires 101 // CONFIGURE_DISPLAY_BRIGHTNESS, and INTERACT_ACROSS_USER if the user being configured is not 102 // the same as the calling user. setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId, String packageName)103 void setBrightnessConfigurationForUser(in BrightnessConfiguration c, int userId, 104 String packageName); 105 106 // Gets the global brightness configuration for a given user. Requires 107 // CONFIGURE_DISPLAY_BRIGHTNESS, and INTERACT_ACROSS_USER if the user is not 108 // the same as the calling user. getBrightnessConfigurationForUser(int userId)109 BrightnessConfiguration getBrightnessConfigurationForUser(int userId); 110 111 // Gets the default brightness configuration if configured. getDefaultBrightnessConfiguration()112 BrightnessConfiguration getDefaultBrightnessConfiguration(); 113 114 // Temporarily sets the display brightness. setTemporaryBrightness(int brightness)115 void setTemporaryBrightness(int brightness); 116 117 // Temporarily sets the auto brightness adjustment factor. setTemporaryAutoBrightnessAdjustment(float adjustment)118 void setTemporaryAutoBrightnessAdjustment(float adjustment); 119 120 // Get the minimum brightness curve. getMinimumBrightnessCurve()121 Curve getMinimumBrightnessCurve(); 122 123 // Gets the id of the preferred wide gamut color space for all displays. 124 // The wide gamut color space is returned from composition pipeline 125 // based on hardware capability. getPreferredWideGamutColorSpaceId()126 int getPreferredWideGamutColorSpaceId(); 127 } 128