1 /*
2  * Copyright (C) 2021 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 
20 import com.android.internal.annotations.VisibleForTesting;
21 
22 import android.annotation.NonNull;
23 import android.annotation.Nullable;
24 import android.content.Context;
25 import android.content.res.Resources;
26 import android.graphics.ColorSpace;
27 import android.graphics.Point;
28 import android.hardware.OverlayProperties;
29 import android.hardware.display.DisplayManager.DisplayListener;
30 import android.media.projection.MediaProjection;
31 import android.os.Handler;
32 import android.util.Pair;
33 import android.view.Display;
34 import android.view.DisplayAdjustments;
35 import android.view.DisplayInfo;
36 import android.view.Surface;
37 
38 import java.util.List;
39 
40 public final class DisplayManagerGlobal {
41     public static final int EVENT_DISPLAY_ADDED = 1;
42     public static final int EVENT_DISPLAY_CHANGED = 2;
43     public static final int EVENT_DISPLAY_REMOVED = 3;
44     public static final int EVENT_DISPLAY_BRIGHTNESS_CHANGED = 4;
45 
46     private static DisplayManagerGlobal sInstance;
47 
48     @VisibleForTesting
DisplayManagerGlobal(IDisplayManager dm)49     public DisplayManagerGlobal(IDisplayManager dm) {}
50 
getInstance()51     public static DisplayManagerGlobal getInstance() {
52         synchronized (DisplayManagerGlobal.class) {
53             if (sInstance == null) {
54                 sInstance = new DisplayManagerGlobal(null);
55             }
56             return sInstance;
57         }
58     }
59 
getDisplayInfo(int displayId)60     public DisplayInfo getDisplayInfo(int displayId) {
61         return null;
62     }
63 
getDisplayIds()64     public int[] getDisplayIds() {
65         return null;
66     }
67 
isUidPresentOnDisplay(int uid, int displayId)68     public boolean isUidPresentOnDisplay(int uid, int displayId) {
69         return false;
70     }
71 
getCompatibleDisplay(int displayId, DisplayAdjustments daj)72     public Display getCompatibleDisplay(int displayId, DisplayAdjustments daj) {
73         return null;
74     }
75 
getCompatibleDisplay(int displayId, Resources resources)76     public Display getCompatibleDisplay(int displayId, Resources resources) {
77         return null;
78     }
79 
getRealDisplay(int displayId)80     public Display getRealDisplay(int displayId) {
81         return null;
82     }
83 
registerDisplayListener(@onNull DisplayListener listener, @Nullable Handler handler, long eventsMask)84     public void registerDisplayListener(@NonNull DisplayListener listener,
85             @Nullable Handler handler, long eventsMask) {}
86 
unregisterDisplayListener(DisplayListener listener)87     public void unregisterDisplayListener(DisplayListener listener) {}
88 
startWifiDisplayScan()89     public void startWifiDisplayScan() {}
90 
stopWifiDisplayScan()91     public void stopWifiDisplayScan() {}
92 
connectWifiDisplay(String deviceAddress)93     public void connectWifiDisplay(String deviceAddress) {}
94 
pauseWifiDisplay()95     public void pauseWifiDisplay() {}
96 
resumeWifiDisplay()97     public void resumeWifiDisplay() {}
98 
disconnectWifiDisplay()99     public void disconnectWifiDisplay() {}
100 
renameWifiDisplay(String deviceAddress, String alias)101     public void renameWifiDisplay(String deviceAddress, String alias) {}
102 
forgetWifiDisplay(String deviceAddress)103     public void forgetWifiDisplay(String deviceAddress) {}
104 
getWifiDisplayStatus()105     public WifiDisplayStatus getWifiDisplayStatus() {
106         return null;
107     }
108 
setUserDisabledHdrTypes(int[] userDisabledHdrTypes)109     public void setUserDisabledHdrTypes(int[] userDisabledHdrTypes) {}
110 
setAreUserDisabledHdrTypesAllowed(boolean areUserDisabledHdrTypesAllowed)111     public void setAreUserDisabledHdrTypesAllowed(boolean areUserDisabledHdrTypesAllowed) {}
112 
areUserDisabledHdrTypesAllowed()113     public boolean areUserDisabledHdrTypesAllowed() {
114         return false;
115     }
116 
getUserDisabledHdrTypes()117     public int[] getUserDisabledHdrTypes() {
118         return null;
119     }
120 
requestColorMode(int displayId, int colorMode)121     public void requestColorMode(int displayId, int colorMode) {}
122 
createVirtualDisplay(@onNull Context context, MediaProjection projection, @NonNull VirtualDisplayConfig virtualDisplayConfig, VirtualDisplay.Callback callback, Handler handler)123     public VirtualDisplay createVirtualDisplay(@NonNull Context context, MediaProjection projection,
124             @NonNull VirtualDisplayConfig virtualDisplayConfig, VirtualDisplay.Callback callback,
125             Handler handler) {
126         return null;
127     }
128 
setVirtualDisplaySurface(IVirtualDisplayCallback token, Surface surface)129     public void setVirtualDisplaySurface(IVirtualDisplayCallback token, Surface surface) {}
130 
resizeVirtualDisplay(IVirtualDisplayCallback token, int width, int height, int densityDpi)131     public void resizeVirtualDisplay(IVirtualDisplayCallback token,
132             int width, int height, int densityDpi) {}
133 
releaseVirtualDisplay(IVirtualDisplayCallback token)134     public void releaseVirtualDisplay(IVirtualDisplayCallback token) {}
135 
setVirtualDisplayState(IVirtualDisplayCallback token, boolean isOn)136     void setVirtualDisplayState(IVirtualDisplayCallback token, boolean isOn) {}
137 
getStableDisplaySize()138     public Point getStableDisplaySize() {
139         return null;
140     }
141 
getBrightnessEvents(String callingPackage)142     public List<BrightnessChangeEvent> getBrightnessEvents(String callingPackage) {
143         return null;
144     }
145 
getBrightnessInfo(int displayId)146     public BrightnessInfo getBrightnessInfo(int displayId) {
147         return null;
148     }
149 
getPreferredWideGamutColorSpace()150     public ColorSpace getPreferredWideGamutColorSpace() {
151         return null;
152     }
153 
getOverlaySupport()154     public OverlayProperties getOverlaySupport() { return null; }
155 
setBrightnessConfigurationForUser(BrightnessConfiguration c, int userId, String packageName)156     public void setBrightnessConfigurationForUser(BrightnessConfiguration c, int userId,
157             String packageName) {}
158 
getBrightnessConfigurationForUser(int userId)159     public BrightnessConfiguration getBrightnessConfigurationForUser(int userId) {
160         return null;
161     }
162 
getDefaultBrightnessConfiguration()163     public BrightnessConfiguration getDefaultBrightnessConfiguration() {
164         return null;
165     }
166 
isMinimalPostProcessingRequested(int displayId)167     public boolean isMinimalPostProcessingRequested(int displayId) {
168         return false;
169     }
170 
setTemporaryBrightness(int displayId, float brightness)171     public void setTemporaryBrightness(int displayId, float brightness) {}
172 
setBrightness(int displayId, float brightness)173     public void setBrightness(int displayId, float brightness) {}
174 
getBrightness(int displayId)175     public float getBrightness(int displayId) {
176         return 0.0f;
177     }
178 
setTemporaryAutoBrightnessAdjustment(float adjustment)179     public void setTemporaryAutoBrightnessAdjustment(float adjustment) {}
180 
getMinimumBrightnessCurve()181     public Pair<float[], float[]> getMinimumBrightnessCurve() {
182         return null;
183     }
184 
getAmbientBrightnessStats()185     public List<AmbientBrightnessDayStats> getAmbientBrightnessStats() {
186         return null;
187     }
188 
setShouldAlwaysRespectAppRequestedMode(boolean enabled)189     public void setShouldAlwaysRespectAppRequestedMode(boolean enabled) {}
190 
shouldAlwaysRespectAppRequestedMode()191     public boolean shouldAlwaysRespectAppRequestedMode() {
192         return false;
193     }
194 
setRefreshRateSwitchingType(int newValue)195     public void setRefreshRateSwitchingType(int newValue) {}
196 
getRefreshRateSwitchingType()197     public int getRefreshRateSwitchingType() {
198         return 0;
199     }
200 
201     public static final String CACHE_KEY_DISPLAY_INFO_PROPERTY =
202             "cache_key.display_info";
203 
invalidateLocalDisplayInfoCaches()204     public static void invalidateLocalDisplayInfoCaches() {}
205 
disableLocalDisplayInfoCaches()206     public void disableLocalDisplayInfoCaches() {}
207 }
208