diff options
| author | Louis Chang <louischang@google.com> | 2018-08-29 17:44:34 +0800 |
|---|---|---|
| committer | Andrii Kulian <akulian@google.com> | 2018-10-04 00:39:29 +0000 |
| commit | bd48dca2d06dcb75b840a68e3fe502b73e2689ae (patch) | |
| tree | bcfdf9c9e6fd0424888055c757011ef54569d77f /core/java/android/view/Display.java | |
| parent | 331101321fa413dc55c6f930f068db0d9c367ace (diff) | |
Support launching home activity on secondary display
- Add a new flag indicating that the display should show
system decorations, such as status bar, nav bar, home and IME.
- Automatically launches home activity on secondary display
if the display support system decorations and home
activity has multiple instances supports.
- Remove ActivityStackSupervisor#mHomeStack and move several
home stack related methods to ActivityDisplay.
Bug: 111363427
Test: atest ActivityManagerMultiDisplayTests
atest com.android.server.am
Manual test on virtual display and chromecast
Change-Id: I48fe245ad12965a19a6768f5dbb4e974ce94b01a
Diffstat (limited to 'core/java/android/view/Display.java')
| -rw-r--r-- | core/java/android/view/Display.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index 4d96fc3175cd..719a401ce0cf 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -221,6 +221,18 @@ public final class Display { public static final int FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD = 1 << 5; /** + * Display flag: Indicates that the display should show system decorations. + * <p> + * This flag identifies secondary displays that should show system decorations, such as status + * bar, navigation bar, home activity or IME. + * </p> + * + * @see #supportsSystemDecorations + * @hide + */ + public static final int FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS = 1 << 6; + + /** * Display flag: Indicates that the contents of the display should not be scaled * to fit the physical screen dimensions. Used for development only to emulate * devices with smaller physicals screens while preserving density. @@ -874,6 +886,16 @@ public final class Display { } /** + * Returns whether this display should support showing system decorations. + * + * @see #FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS + * @hide + */ + public boolean supportsSystemDecorations() { + return (mDisplayInfo.flags & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) != 0; + } + + /** * Returns the display's HDR capabilities. * * @see #isHdr() |
