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.hardware.display.IDisplayManagerCallback; 20 import android.hardware.display.IVirtualDisplayCallback; 21 import android.hardware.display.WifiDisplay; 22 import android.hardware.display.WifiDisplayStatus; 23 import android.media.projection.IMediaProjection; 24 import android.view.DisplayInfo; 25 import android.view.Surface; 26 27 /** @hide */ 28 interface IDisplayManager { getDisplayInfo(int displayId)29 DisplayInfo getDisplayInfo(int displayId); getDisplayIds()30 int[] getDisplayIds(); 31 registerCallback(in IDisplayManagerCallback callback)32 void registerCallback(in IDisplayManagerCallback callback); 33 34 // Requires CONFIGURE_WIFI_DISPLAY permission. 35 // The process must have previously registered a callback. startWifiDisplayScan()36 void startWifiDisplayScan(); 37 38 // Requires CONFIGURE_WIFI_DISPLAY permission. stopWifiDisplayScan()39 void stopWifiDisplayScan(); 40 41 // Requires CONFIGURE_WIFI_DISPLAY permission. connectWifiDisplay(String address)42 void connectWifiDisplay(String address); 43 44 // No permissions required. disconnectWifiDisplay()45 void disconnectWifiDisplay(); 46 47 // Requires CONFIGURE_WIFI_DISPLAY permission. renameWifiDisplay(String address, String alias)48 void renameWifiDisplay(String address, String alias); 49 50 // Requires CONFIGURE_WIFI_DISPLAY permission. forgetWifiDisplay(String address)51 void forgetWifiDisplay(String address); 52 53 // Requires CONFIGURE_WIFI_DISPLAY permission. pauseWifiDisplay()54 void pauseWifiDisplay(); 55 56 // Requires CONFIGURE_WIFI_DISPLAY permission. resumeWifiDisplay()57 void resumeWifiDisplay(); 58 59 // No permissions required. getWifiDisplayStatus()60 WifiDisplayStatus getWifiDisplayStatus(); 61 62 // Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate 63 // 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)64 int createVirtualDisplay(in IVirtualDisplayCallback callback, 65 in IMediaProjection projectionToken, String packageName, String name, 66 int width, int height, int densityDpi, in Surface surface, int flags); 67 68 // No permissions required, but must be same Uid as the creator. resizeVirtualDisplay(in IVirtualDisplayCallback token, int width, int height, int densityDpi)69 void resizeVirtualDisplay(in IVirtualDisplayCallback token, 70 int width, int height, int densityDpi); 71 72 // No permissions required but must be same Uid as the creator. setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface)73 void setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface); 74 75 // No permissions required but must be same Uid as the creator. releaseVirtualDisplay(in IVirtualDisplayCallback token)76 void releaseVirtualDisplay(in IVirtualDisplayCallback token); 77 } 78