summaryrefslogtreecommitdiff
path: root/core/java/android/app/WindowConfiguration.java
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2017-08-29 11:24:37 -0700
committerWale Ogunwale <ogunwale@google.com>2017-09-08 05:13:18 -0700
commit926aade03600c7fe62ccb115c6f55889cb892457 (patch)
tree10bac19c2f15d5c6e4e69e72227fbe7e9120f4bb /core/java/android/app/WindowConfiguration.java
parent6cbbc9a0a13caa1e9f748e1d2a3d1fbf83c1407c (diff)
Introducing split-screen windowing modes.
WINDOWING_MODE_SPLIT_SCREEN_PRIMARY is what used to be the docked windowing mode and is used to indicated the primary container dirving the split-screen windowing mode. WINDOWING_MODE_SPLIT_SCREEN_SECONDARY is the windowing mode of any container to the side/adjacent to the primary split-screen container. For example, any container that was in fullscreen mode and that should now be adjacent to the primary split-screen container will. Test: go/wm-smoke Test: WM Unit tests via TreeHugger Change-Id: Idc8560073c613c708cb40ba8449641a6be11d9f1
Diffstat (limited to 'core/java/android/app/WindowConfiguration.java')
-rw-r--r--core/java/android/app/WindowConfiguration.java31
1 files changed, 26 insertions, 5 deletions
diff --git a/core/java/android/app/WindowConfiguration.java b/core/java/android/app/WindowConfiguration.java
index b69cd026776b..515248512255 100644
--- a/core/java/android/app/WindowConfiguration.java
+++ b/core/java/android/app/WindowConfiguration.java
@@ -57,19 +57,26 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
/** Always on-top (always visible). of other siblings in its parent container.
* @hide */
public static final int WINDOWING_MODE_PINNED = 2;
- /** Occupies a dedicated region of the screen or its parent container.
+ /** The primary container driving the screen to be in split-screen mode.
* @hide */
- public static final int WINDOWING_MODE_DOCKED = 3;
+ public static final int WINDOWING_MODE_SPLIT_SCREEN_PRIMARY = 3;
+ /**
+ * The containers adjacent to the {@link #WINDOWING_MODE_SPLIT_SCREEN_PRIMARY} container in
+ * split-screen mode.
+ * @hide
+ */
+ public static final int WINDOWING_MODE_SPLIT_SCREEN_SECONDARY = 4;
/** Can be freely resized within its parent container.
* @hide */
- public static final int WINDOWING_MODE_FREEFORM = 4;
+ public static final int WINDOWING_MODE_FREEFORM = 5;
/** @hide */
@IntDef({
WINDOWING_MODE_UNDEFINED,
WINDOWING_MODE_FULLSCREEN,
WINDOWING_MODE_PINNED,
- WINDOWING_MODE_DOCKED,
+ WINDOWING_MODE_SPLIT_SCREEN_PRIMARY,
+ WINDOWING_MODE_SPLIT_SCREEN_SECONDARY,
WINDOWING_MODE_FREEFORM,
})
public @interface WindowingMode {}
@@ -469,12 +476,26 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
return mWindowingMode == WINDOWING_MODE_PINNED;
}
+ /**
+ * Returns true if this container can be put in either
+ * {@link #WINDOWING_MODE_SPLIT_SCREEN_PRIMARY} or
+ * {@link #WINDOWING_MODE_SPLIT_SCREEN_SECONDARY} windowing modes based on its current state.
+ * @hide
+ */
+ public boolean supportSplitScreenWindowingMode() {
+ if (mActivityType == ACTIVITY_TYPE_ASSISTANT) {
+ return false;
+ }
+ return mWindowingMode != WINDOWING_MODE_FREEFORM && mWindowingMode != WINDOWING_MODE_PINNED;
+ }
+
private static String windowingModeToString(@WindowingMode int windowingMode) {
switch (windowingMode) {
case WINDOWING_MODE_UNDEFINED: return "undefined";
case WINDOWING_MODE_FULLSCREEN: return "fullscreen";
case WINDOWING_MODE_PINNED: return "pinned";
- case WINDOWING_MODE_DOCKED: return "docked";
+ case WINDOWING_MODE_SPLIT_SCREEN_PRIMARY: return "split-screen-primary";
+ case WINDOWING_MODE_SPLIT_SCREEN_SECONDARY: return "split-screen-secondary";
case WINDOWING_MODE_FREEFORM: return "freeform";
}
return String.valueOf(windowingMode);