diff options
| author | Wale Ogunwale <ogunwale@google.com> | 2017-09-29 05:09:09 -0700 |
|---|---|---|
| committer | Wale Ogunwale <ogunwale@google.com> | 2017-10-11 07:40:46 -0700 |
| commit | 44f036fd5a5ea3253f8df979898f720edbc1af82 (patch) | |
| tree | 4eafdaf108cef5c8bd84a07e40b624e34bdc3394 /core/java/android | |
| parent | 9eb155567d911516ed23bad643b47486d6cc6fcd (diff) | |
Removed remaining use of static stack ids.
Replace by windowingMode and activityType.
Test: Existing tests pass.
Test: go/wm-smoke
Bug: 64146578
Change-Id: I2ff026de3ead1a3e7136df17c68ed37d7aae5495
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/ActivityManager.java | 132 | ||||
| -rw-r--r-- | core/java/android/app/ActivityOptions.java | 1 | ||||
| -rw-r--r-- | core/java/android/app/WindowConfiguration.java | 3 | ||||
| -rw-r--r-- | core/java/android/view/WindowManagerInternal.java | 4 | ||||
| -rw-r--r-- | core/java/android/view/WindowManagerPolicy.java | 7 |
5 files changed, 6 insertions, 141 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index 5e61727fc1c3..2ba6e01b8966 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -670,138 +670,6 @@ public class ActivityManager { /** Invalid stack ID. */ public static final int INVALID_STACK_ID = -1; - /** First static stack ID. - * @hide */ - private static final int FIRST_STATIC_STACK_ID = 0; - - /** ID of stack where fullscreen activities are normally launched into. - * @hide */ - public static final int FULLSCREEN_WORKSPACE_STACK_ID = 1; - - /** ID of stack where freeform/resized activities are normally launched into. - * @hide */ - public static final int FREEFORM_WORKSPACE_STACK_ID = FULLSCREEN_WORKSPACE_STACK_ID + 1; - - /** ID of stack that occupies a dedicated region of the screen. - * @hide */ - public static final int DOCKED_STACK_ID = FREEFORM_WORKSPACE_STACK_ID + 1; - - /** ID of stack that always on top (always visible) when it exist. - * @hide */ - public static final int PINNED_STACK_ID = DOCKED_STACK_ID + 1; - - /** Last static stack stack ID. - * @hide */ - private static final int LAST_STATIC_STACK_ID = PINNED_STACK_ID; - - /** Start of ID range used by stacks that are created dynamically. - * @hide */ - public static final int FIRST_DYNAMIC_STACK_ID = LAST_STATIC_STACK_ID + 1; - - // TODO: Figure-out a way to remove this. - /** @hide */ - public static boolean isStaticStack(int stackId) { - return stackId >= FIRST_STATIC_STACK_ID && stackId <= LAST_STATIC_STACK_ID; - } - - // TODO: It seems this mostly means a stack on a secondary display now. Need to see if - // there are other meanings. If not why not just use information from the display? - /** @hide */ - public static boolean isDynamicStack(int stackId) { - return stackId >= FIRST_DYNAMIC_STACK_ID; - } - - /** - * Returns true if we try to maintain focus in the current stack when the top activity - * finishes. - * @hide - */ - // TODO: Figure-out a way to remove. Probably isn't needed in the new world... - public static boolean keepFocusInStackIfPossible(int stackId) { - return stackId == FREEFORM_WORKSPACE_STACK_ID - || stackId == DOCKED_STACK_ID || stackId == PINNED_STACK_ID; - } - - /** - * Returns true if the windows of tasks being moved to the target stack from the source - * stack should be replaced, meaning that window manager will keep the old window around - * until the new is ready. - * @hide - */ - public static boolean replaceWindowsOnTaskMove(int sourceStackId, int targetStackId) { - return sourceStackId == FREEFORM_WORKSPACE_STACK_ID - || targetStackId == FREEFORM_WORKSPACE_STACK_ID; - } - - /** - * Returns true if the top task in the task is allowed to return home when finished and - * there are other tasks in the stack. - * @hide - */ - public static boolean allowTopTaskToReturnHome(int stackId) { - return stackId != PINNED_STACK_ID; - } - - /** - * Returns true if the stack should be resized to match the bounds specified by - * {@link ActivityOptions#setLaunchBounds} when launching an activity into the stack. - * @hide - */ - public static boolean resizeStackWithLaunchBounds(int stackId) { - return stackId == PINNED_STACK_ID; - } - - /** - * Returns true if a window from the specified stack with {@param stackId} are normally - * fullscreen, i. e. they can become the top opaque fullscreen window, meaning that it - * controls system bars, lockscreen occluded/dismissing state, screen rotation animation, - * etc. - * @hide - */ - // TODO: What about the other side of docked stack if we move this to WindowConfiguration? - public static boolean normallyFullscreenWindows(int stackId) { - return stackId != PINNED_STACK_ID && stackId != FREEFORM_WORKSPACE_STACK_ID - && stackId != DOCKED_STACK_ID; - } - - /** Returns the stack id for the input windowing mode. - * @hide */ - // TODO: To be removed once we are not using stack id for stuff... - public static int getStackIdForWindowingMode(int windowingMode) { - switch (windowingMode) { - case WINDOWING_MODE_PINNED: return PINNED_STACK_ID; - case WINDOWING_MODE_FREEFORM: return FREEFORM_WORKSPACE_STACK_ID; - case WINDOWING_MODE_SPLIT_SCREEN_PRIMARY: return DOCKED_STACK_ID; - case WINDOWING_MODE_SPLIT_SCREEN_SECONDARY: return FULLSCREEN_WORKSPACE_STACK_ID; - case WINDOWING_MODE_FULLSCREEN: return FULLSCREEN_WORKSPACE_STACK_ID; - default: return INVALID_STACK_ID; - } - } - - /** Returns the windowing mode that should be used for this input stack id. - * @hide */ - // TODO: To be removed once we are not using stack id for stuff... - public static int getWindowingModeForStackId(int stackId, boolean inSplitScreenMode) { - final int windowingMode; - switch (stackId) { - case FULLSCREEN_WORKSPACE_STACK_ID: - windowingMode = inSplitScreenMode - ? WINDOWING_MODE_SPLIT_SCREEN_SECONDARY : WINDOWING_MODE_FULLSCREEN; - break; - case PINNED_STACK_ID: - windowingMode = WINDOWING_MODE_PINNED; - break; - case DOCKED_STACK_ID: - windowingMode = WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; - break; - case FREEFORM_WORKSPACE_STACK_ID: - windowingMode = WINDOWING_MODE_FREEFORM; - break; - default : - windowingMode = WINDOWING_MODE_UNDEFINED; - } - return windowingMode; - } } /** diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java index a68c3a5c29a6..f14831d1c658 100644 --- a/core/java/android/app/ActivityOptions.java +++ b/core/java/android/app/ActivityOptions.java @@ -17,7 +17,6 @@ package android.app; import static android.app.ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT; -import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.view.Display.INVALID_DISPLAY; diff --git a/core/java/android/app/WindowConfiguration.java b/core/java/android/app/WindowConfiguration.java index 6b4053842338..251863cae205 100644 --- a/core/java/android/app/WindowConfiguration.java +++ b/core/java/android/app/WindowConfiguration.java @@ -511,7 +511,8 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu return windowingMode != WINDOWING_MODE_FREEFORM && windowingMode != WINDOWING_MODE_PINNED; } - private static String windowingModeToString(@WindowingMode int windowingMode) { + /** @hide */ + public static String windowingModeToString(@WindowingMode int windowingMode) { switch (windowingMode) { case WINDOWING_MODE_UNDEFINED: return "undefined"; case WINDOWING_MODE_FULLSCREEN: return "fullscreen"; diff --git a/core/java/android/view/WindowManagerInternal.java b/core/java/android/view/WindowManagerInternal.java index 98f8dc8e3a6d..69cc1002c5ba 100644 --- a/core/java/android/view/WindowManagerInternal.java +++ b/core/java/android/view/WindowManagerInternal.java @@ -335,8 +335,8 @@ public abstract class WindowManagerInternal { public abstract void setOnHardKeyboardStatusChangeListener( OnHardKeyboardStatusChangeListener listener); - /** Returns true if the stack with the input Id is currently visible. */ - public abstract boolean isStackVisible(int stackId); + /** Returns true if a stack in the windowing mode is currently visible. */ + public abstract boolean isStackVisible(int windowingMode); /** * @return True if and only if the docked divider is currently in resize mode. diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index da72535d54ec..137e551dbc9e 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -467,11 +467,8 @@ public interface WindowManagerPolicy { */ public boolean isDimming(); - /** - * @return the stack id this windows belongs to, or {@link StackId#INVALID_STACK_ID} if - * not attached to any stack. - */ - int getStackId(); + /** @return the current windowing mode of this window. */ + int getWindowingMode(); /** * Returns true if the window is current in multi-windowing mode. i.e. it shares the |
