Loading core/api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2730,6 +2730,7 @@ package android.view { method @NonNull public android.view.Display.Mode getDefaultMode(); method @NonNull public int[] getReportedHdrTypes(); method @NonNull public android.graphics.ColorSpace[] getSupportedWideColorGamut(); method @Nullable public android.view.Display.Mode getSystemPreferredDisplayMode(); method public int getType(); method @Nullable public android.view.Display.Mode getUserPreferredDisplayMode(); method public boolean hasAccess(int); Loading core/java/android/hardware/display/DisplayManagerGlobal.java +11 −0 Original line number Diff line number Diff line Loading @@ -915,6 +915,17 @@ public final class DisplayManagerGlobal { } } /** * Returns the system preferred display mode. */ public Display.Mode getSystemPreferredDisplayMode(int displayId) { try { return mDm.getSystemPreferredDisplayMode(displayId); } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } } /** * When enabled the app requested display resolution and refresh rate is always selected * in DisplayModeDirector regardless of user settings and policies for low brightness, low Loading core/java/android/hardware/display/IDisplayManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,7 @@ interface IDisplayManager { // Requires MODIFY_USER_PREFERRED_DISPLAY_MODE permission. void setUserPreferredDisplayMode(int displayId, in Mode mode); Mode getUserPreferredDisplayMode(int displayId); Mode getSystemPreferredDisplayMode(int displayId); // When enabled the app requested display resolution and refresh rate is always selected // in DisplayModeDirector regardless of user settings and policies for low brightness, low Loading core/java/android/view/Display.java +13 −0 Original line number Diff line number Diff line Loading @@ -1117,6 +1117,19 @@ public final class Display { return mDisplayInfo.removeMode; } /** * Returns the system's preferred display mode. This mode will be used when the user has not * specified a display-mode preference. This returns null if the boot display mode feature is * not supported by system. * * @hide */ @TestApi @Nullable public Display.Mode getSystemPreferredDisplayMode() { return mGlobal.getSystemPreferredDisplayMode(getDisplayId()); } /** * Returns the display's HDR capabilities. * Loading core/java/android/view/SurfaceControl.java +39 −2 Original line number Diff line number Diff line Loading @@ -197,6 +197,9 @@ public final class SurfaceControl implements Parcelable { private static native int[] nativeGetCompositionDataspaces(); private static native boolean nativeSetActiveColorMode(IBinder displayToken, int colorMode); private static native boolean nativeGetBootDisplayModeSupport(); private static native void nativeSetBootDisplayMode(IBinder displayToken, int displayMode); private static native void nativeClearBootDisplayMode(IBinder displayToken); private static native void nativeSetAutoLowLatencyMode(IBinder displayToken, boolean on); private static native void nativeSetGameContentType(IBinder displayToken, boolean on); private static native void nativeSetDisplayPowerMode( Loading Loading @@ -1878,6 +1881,8 @@ public final class SurfaceControl implements Parcelable { public boolean autoLowLatencyModeSupported; public boolean gameContentTypeSupported; public int preferredBootDisplayMode; @Override public String toString() { return "DynamicDisplayInfo{" Loading @@ -1887,7 +1892,8 @@ public final class SurfaceControl implements Parcelable { + ", activeColorMode=" + activeColorMode + ", hdrCapabilities=" + hdrCapabilities + ", autoLowLatencyModeSupported=" + autoLowLatencyModeSupported + ", gameContentTypeSupported" + gameContentTypeSupported + "}"; + ", gameContentTypeSupported" + gameContentTypeSupported + ", preferredBootDisplayMode" + preferredBootDisplayMode + "}"; } @Override Loading @@ -1899,7 +1905,8 @@ public final class SurfaceControl implements Parcelable { && activeDisplayModeId == that.activeDisplayModeId && Arrays.equals(supportedColorModes, that.supportedColorModes) && activeColorMode == that.activeColorMode && Objects.equals(hdrCapabilities, that.hdrCapabilities); && Objects.equals(hdrCapabilities, that.hdrCapabilities) && preferredBootDisplayMode == that.preferredBootDisplayMode; } @Override Loading Loading @@ -2263,6 +2270,36 @@ public final class SurfaceControl implements Parcelable { return colorSpaces; } /** * @hide */ public static boolean getBootDisplayModeSupport() { return nativeGetBootDisplayModeSupport(); } /** There is no associated getter for this method. When this is set, the display is expected * to start up in this mode next time the device reboots. * @hide */ public static void setBootDisplayMode(IBinder displayToken, int displayModeId) { if (displayToken == null) { throw new IllegalArgumentException("displayToken must not be null"); } nativeSetBootDisplayMode(displayToken, displayModeId); } /** * @hide */ public static void clearBootDisplayMode(IBinder displayToken) { if (displayToken == null) { throw new IllegalArgumentException("displayToken must not be null"); } nativeClearBootDisplayMode(displayToken); } /** * @hide */ Loading Loading
core/api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2730,6 +2730,7 @@ package android.view { method @NonNull public android.view.Display.Mode getDefaultMode(); method @NonNull public int[] getReportedHdrTypes(); method @NonNull public android.graphics.ColorSpace[] getSupportedWideColorGamut(); method @Nullable public android.view.Display.Mode getSystemPreferredDisplayMode(); method public int getType(); method @Nullable public android.view.Display.Mode getUserPreferredDisplayMode(); method public boolean hasAccess(int); Loading
core/java/android/hardware/display/DisplayManagerGlobal.java +11 −0 Original line number Diff line number Diff line Loading @@ -915,6 +915,17 @@ public final class DisplayManagerGlobal { } } /** * Returns the system preferred display mode. */ public Display.Mode getSystemPreferredDisplayMode(int displayId) { try { return mDm.getSystemPreferredDisplayMode(displayId); } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } } /** * When enabled the app requested display resolution and refresh rate is always selected * in DisplayModeDirector regardless of user settings and policies for low brightness, low Loading
core/java/android/hardware/display/IDisplayManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,7 @@ interface IDisplayManager { // Requires MODIFY_USER_PREFERRED_DISPLAY_MODE permission. void setUserPreferredDisplayMode(int displayId, in Mode mode); Mode getUserPreferredDisplayMode(int displayId); Mode getSystemPreferredDisplayMode(int displayId); // When enabled the app requested display resolution and refresh rate is always selected // in DisplayModeDirector regardless of user settings and policies for low brightness, low Loading
core/java/android/view/Display.java +13 −0 Original line number Diff line number Diff line Loading @@ -1117,6 +1117,19 @@ public final class Display { return mDisplayInfo.removeMode; } /** * Returns the system's preferred display mode. This mode will be used when the user has not * specified a display-mode preference. This returns null if the boot display mode feature is * not supported by system. * * @hide */ @TestApi @Nullable public Display.Mode getSystemPreferredDisplayMode() { return mGlobal.getSystemPreferredDisplayMode(getDisplayId()); } /** * Returns the display's HDR capabilities. * Loading
core/java/android/view/SurfaceControl.java +39 −2 Original line number Diff line number Diff line Loading @@ -197,6 +197,9 @@ public final class SurfaceControl implements Parcelable { private static native int[] nativeGetCompositionDataspaces(); private static native boolean nativeSetActiveColorMode(IBinder displayToken, int colorMode); private static native boolean nativeGetBootDisplayModeSupport(); private static native void nativeSetBootDisplayMode(IBinder displayToken, int displayMode); private static native void nativeClearBootDisplayMode(IBinder displayToken); private static native void nativeSetAutoLowLatencyMode(IBinder displayToken, boolean on); private static native void nativeSetGameContentType(IBinder displayToken, boolean on); private static native void nativeSetDisplayPowerMode( Loading Loading @@ -1878,6 +1881,8 @@ public final class SurfaceControl implements Parcelable { public boolean autoLowLatencyModeSupported; public boolean gameContentTypeSupported; public int preferredBootDisplayMode; @Override public String toString() { return "DynamicDisplayInfo{" Loading @@ -1887,7 +1892,8 @@ public final class SurfaceControl implements Parcelable { + ", activeColorMode=" + activeColorMode + ", hdrCapabilities=" + hdrCapabilities + ", autoLowLatencyModeSupported=" + autoLowLatencyModeSupported + ", gameContentTypeSupported" + gameContentTypeSupported + "}"; + ", gameContentTypeSupported" + gameContentTypeSupported + ", preferredBootDisplayMode" + preferredBootDisplayMode + "}"; } @Override Loading @@ -1899,7 +1905,8 @@ public final class SurfaceControl implements Parcelable { && activeDisplayModeId == that.activeDisplayModeId && Arrays.equals(supportedColorModes, that.supportedColorModes) && activeColorMode == that.activeColorMode && Objects.equals(hdrCapabilities, that.hdrCapabilities); && Objects.equals(hdrCapabilities, that.hdrCapabilities) && preferredBootDisplayMode == that.preferredBootDisplayMode; } @Override Loading Loading @@ -2263,6 +2270,36 @@ public final class SurfaceControl implements Parcelable { return colorSpaces; } /** * @hide */ public static boolean getBootDisplayModeSupport() { return nativeGetBootDisplayModeSupport(); } /** There is no associated getter for this method. When this is set, the display is expected * to start up in this mode next time the device reboots. * @hide */ public static void setBootDisplayMode(IBinder displayToken, int displayModeId) { if (displayToken == null) { throw new IllegalArgumentException("displayToken must not be null"); } nativeSetBootDisplayMode(displayToken, displayModeId); } /** * @hide */ public static void clearBootDisplayMode(IBinder displayToken) { if (displayToken == null) { throw new IllegalArgumentException("displayToken must not be null"); } nativeClearBootDisplayMode(displayToken); } /** * @hide */ Loading