Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -16561,6 +16561,7 @@ package android.hardware.display { method public android.view.Display getDisplay(int); method public android.view.Display[] getDisplays(); method public android.view.Display[] getDisplays(java.lang.String); method public android.graphics.Point getStableDisplaySize(); method public void registerDisplayListener(android.hardware.display.DisplayManager.DisplayListener, android.os.Handler); method public void unregisterDisplayListener(android.hardware.display.DisplayManager.DisplayListener); field public static final java.lang.String DISPLAY_CATEGORY_PRESENTATION = "android.hardware.display.category.PRESENTATION"; core/java/android/hardware/display/DisplayManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -18,8 +18,10 @@ package android.hardware.display; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SystemService; import android.content.Context; import android.graphics.Point; import android.media.projection.MediaProjection; import android.os.Handler; import android.util.SparseArray; Loading Loading @@ -585,6 +587,20 @@ public final class DisplayManager { name, width, height, densityDpi, surface, flags, callback, handler, uniqueId); } /** * Gets the stable device display size, in pixels. * * This should really only be used for things like server-side filtering of available * applications. Most applications don't need the level of stability guaranteed by this and * should instead query either the size of the display they're currently running on or the * size of the default display. * @hide */ @SystemApi public Point getStableDisplaySize() { return mGlobal.getStableDisplaySize(); } /** * Listens for changes in available display devices. */ Loading core/java/android/hardware/display/DisplayManagerGlobal.java +12 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.hardware.display; import android.content.Context; import android.content.res.Resources; import android.graphics.Point; import android.hardware.display.DisplayManager.DisplayListener; import android.media.projection.IMediaProjection; import android.media.projection.MediaProjection; Loading Loading @@ -444,6 +445,17 @@ public final class DisplayManagerGlobal { } } /** * Gets the stable device display size, in pixels. */ public Point getStableDisplaySize() { try { return mDm.getStableDisplaySize(); } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } } private final class DisplayManagerCallback extends IDisplayManagerCallback.Stub { @Override public void onDisplayEvent(int displayId, int event) { Loading core/java/android/hardware/display/IDisplayManager.aidl +4 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.hardware.display; import android.graphics.Point; import android.hardware.display.IDisplayManagerCallback; import android.hardware.display.IVirtualDisplayCallback; import android.hardware.display.WifiDisplay; Loading Loading @@ -77,4 +78,7 @@ interface IDisplayManager { // No permissions required but must be same Uid as the creator. void releaseVirtualDisplay(in IVirtualDisplayCallback token); // Get a stable metric for the device's display size. No permissions required. Point getStableDisplaySize(); } core/res/res/values/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -3044,4 +3044,10 @@ <!-- Allow SystemUI to show the shutdown dialog --> <bool name="config_showSysuiShutdown">true</bool> <!-- The stable device width and height in pixels. If these aren't set to a positive number then the device will use the width and height of the default display the first time it's booted. --> <integer name="config_stableDeviceDisplayWidth">-1</integer> <integer name="config_stableDeviceDisplayHeight">-1</integer> </resources> Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -16561,6 +16561,7 @@ package android.hardware.display { method public android.view.Display getDisplay(int); method public android.view.Display[] getDisplays(); method public android.view.Display[] getDisplays(java.lang.String); method public android.graphics.Point getStableDisplaySize(); method public void registerDisplayListener(android.hardware.display.DisplayManager.DisplayListener, android.os.Handler); method public void unregisterDisplayListener(android.hardware.display.DisplayManager.DisplayListener); field public static final java.lang.String DISPLAY_CATEGORY_PRESENTATION = "android.hardware.display.category.PRESENTATION";
core/java/android/hardware/display/DisplayManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -18,8 +18,10 @@ package android.hardware.display; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SystemService; import android.content.Context; import android.graphics.Point; import android.media.projection.MediaProjection; import android.os.Handler; import android.util.SparseArray; Loading Loading @@ -585,6 +587,20 @@ public final class DisplayManager { name, width, height, densityDpi, surface, flags, callback, handler, uniqueId); } /** * Gets the stable device display size, in pixels. * * This should really only be used for things like server-side filtering of available * applications. Most applications don't need the level of stability guaranteed by this and * should instead query either the size of the display they're currently running on or the * size of the default display. * @hide */ @SystemApi public Point getStableDisplaySize() { return mGlobal.getStableDisplaySize(); } /** * Listens for changes in available display devices. */ Loading
core/java/android/hardware/display/DisplayManagerGlobal.java +12 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.hardware.display; import android.content.Context; import android.content.res.Resources; import android.graphics.Point; import android.hardware.display.DisplayManager.DisplayListener; import android.media.projection.IMediaProjection; import android.media.projection.MediaProjection; Loading Loading @@ -444,6 +445,17 @@ public final class DisplayManagerGlobal { } } /** * Gets the stable device display size, in pixels. */ public Point getStableDisplaySize() { try { return mDm.getStableDisplaySize(); } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } } private final class DisplayManagerCallback extends IDisplayManagerCallback.Stub { @Override public void onDisplayEvent(int displayId, int event) { Loading
core/java/android/hardware/display/IDisplayManager.aidl +4 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.hardware.display; import android.graphics.Point; import android.hardware.display.IDisplayManagerCallback; import android.hardware.display.IVirtualDisplayCallback; import android.hardware.display.WifiDisplay; Loading Loading @@ -77,4 +78,7 @@ interface IDisplayManager { // No permissions required but must be same Uid as the creator. void releaseVirtualDisplay(in IVirtualDisplayCallback token); // Get a stable metric for the device's display size. No permissions required. Point getStableDisplaySize(); }
core/res/res/values/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -3044,4 +3044,10 @@ <!-- Allow SystemUI to show the shutdown dialog --> <bool name="config_showSysuiShutdown">true</bool> <!-- The stable device width and height in pixels. If these aren't set to a positive number then the device will use the width and height of the default display the first time it's booted. --> <integer name="config_stableDeviceDisplayWidth">-1</integer> <integer name="config_stableDeviceDisplayHeight">-1</integer> </resources>