Loading core/java/android/view/Display.java +6 −1 Original line number Diff line number Diff line Loading @@ -1786,7 +1786,12 @@ public final class Display { * {@code getWindowManager()} or {@code getSystemService(Context.WINDOW_SERVICE)}), the * returned metrics provide the size of the current app window. As a result, in * multi-window mode, the returned size can be smaller than the size of the device * screen. * screen. System decoration handling may vary depending on API level: * <ul> * <li>API level 35 and above, the window size will be returned. * <li>API level 34 and below, the window size minus system decoration areas and * display cutout is returned. * </ul> * <li>If metrics are requested from a non-activity context (for example, the application * context, where the WindowManager is accessed by * {@code getApplicationContext().getSystemService(Context.WINDOW_SERVICE)}), the Loading core/java/android/view/WindowMetrics.java +2 −2 Original line number Diff line number Diff line Loading @@ -107,8 +107,8 @@ public final class WindowMetrics { * and display cutout areas depending on the calling context and target SDK level. Please refer * to {@link Display#getSize(Point)} for details. * <p> * The value reported by {@link Display#getSize(Point)} excluding system decoration areas can be * obtained by using: * The following code snippet shows how to get the bounds excluding navigation bars and display * cutout: * <pre class="prettyprint"> * final WindowMetrics metrics = windowManager.getCurrentWindowMetrics(); * // Gets all excluding insets Loading Loading
core/java/android/view/Display.java +6 −1 Original line number Diff line number Diff line Loading @@ -1786,7 +1786,12 @@ public final class Display { * {@code getWindowManager()} or {@code getSystemService(Context.WINDOW_SERVICE)}), the * returned metrics provide the size of the current app window. As a result, in * multi-window mode, the returned size can be smaller than the size of the device * screen. * screen. System decoration handling may vary depending on API level: * <ul> * <li>API level 35 and above, the window size will be returned. * <li>API level 34 and below, the window size minus system decoration areas and * display cutout is returned. * </ul> * <li>If metrics are requested from a non-activity context (for example, the application * context, where the WindowManager is accessed by * {@code getApplicationContext().getSystemService(Context.WINDOW_SERVICE)}), the Loading
core/java/android/view/WindowMetrics.java +2 −2 Original line number Diff line number Diff line Loading @@ -107,8 +107,8 @@ public final class WindowMetrics { * and display cutout areas depending on the calling context and target SDK level. Please refer * to {@link Display#getSize(Point)} for details. * <p> * The value reported by {@link Display#getSize(Point)} excluding system decoration areas can be * obtained by using: * The following code snippet shows how to get the bounds excluding navigation bars and display * cutout: * <pre class="prettyprint"> * final WindowMetrics metrics = windowManager.getCurrentWindowMetrics(); * // Gets all excluding insets Loading