diff options
| author | Andrii Kulian <akulian@google.com> | 2019-02-21 12:13:28 -0800 |
|---|---|---|
| committer | Andrii Kulian <akulian@google.com> | 2019-02-27 17:58:58 -0800 |
| commit | dd98961be67a7024dcbdedbcba5e903416d633ef (patch) | |
| tree | cdba33a15a9a9e1cb0688df926f3134b0d292a53 /core/java | |
| parent | 79c8d6623b36a6fcccdef0cda8e68d42a094e989 (diff) | |
Read system decor support status from WM
There is no way to add FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS to
hardware or simulated displays, so wallpaper, IME and nav bar were
not showing up even when desktop mode developer option was enabled.
Bug: 123199549
Bug: 125007644
Bug: 124073468
Bug: 124073384
Test: Enable force desktop mode, reboot, create simulated display
Change-Id: Id6f2f3746407467f20c1f26e735b84653e34625d
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/Display.java | 14 | ||||
| -rw-r--r-- | core/java/android/view/WindowManager.java | 16 | ||||
| -rw-r--r-- | core/java/android/view/WindowManagerImpl.java | 9 |
3 files changed, 25 insertions, 14 deletions
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index 94a9a1c0ff30..5df7341892e2 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -21,7 +21,6 @@ import static android.Manifest.permission.CONFIGURE_DISPLAY_COLOR_MODE; import android.annotation.IntDef; import android.annotation.Nullable; import android.annotation.RequiresPermission; -import android.annotation.TestApi; import android.annotation.UnsupportedAppUsage; import android.app.KeyguardManager; import android.content.res.CompatibilityInfo; @@ -231,7 +230,6 @@ public final class Display { * bar, navigation bar, home activity or IME. * </p> * - * @see #supportsSystemDecorations * @hide */ // TODO (b/114338689): Remove the flag and use IWindowManager#setShouldShowSystemDecors @@ -907,18 +905,6 @@ public final class Display { } /** - * Returns whether this display should support showing system decorations. - * - * @see #FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS - * @hide - */ - @TestApi - // TODO (b/114338689): Remove the method and use IWindowManager#shouldShowSystemDecors - public boolean supportsSystemDecorations() { - return (mDisplayInfo.flags & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) != 0; - } - - /** * Returns the display's HDR capabilities. * * @see #isHdr() diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 6326c591aa04..a9a67ea4ec8c 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -481,6 +481,7 @@ public interface WindowManager extends ViewManager { * * @param displayId The id of the display. * @param shouldShow Indicates that the display should show system decors. + * @see #shouldShowSystemDecors(int) * @hide */ @TestApi @@ -488,6 +489,21 @@ public interface WindowManager extends ViewManager { } /** + * Checks if the display supports showing system decors. + * <p> + * System decors include status bar, navigation bar, launcher. + * </p> + * + * @param displayId The id of the display. + * @see #setShouldShowSystemDecors(int, boolean) + * @hide + */ + @TestApi + default boolean shouldShowSystemDecors(int displayId) { + return false; + } + + /** * Sets that the display should show IME. * * @param displayId Display ID. diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java index a102f6c8a74d..2e4db5c4eef9 100644 --- a/core/java/android/view/WindowManagerImpl.java +++ b/core/java/android/view/WindowManagerImpl.java @@ -177,6 +177,15 @@ public final class WindowManagerImpl implements WindowManager { } @Override + public boolean shouldShowSystemDecors(int displayId) { + try { + return WindowManagerGlobal.getWindowManagerService().shouldShowSystemDecors(displayId); + } catch (RemoteException e) { + } + return false; + } + + @Override public void setShouldShowIme(int displayId, boolean shouldShow) { try { WindowManagerGlobal.getWindowManagerService().setShouldShowIme(displayId, shouldShow); |
