summaryrefslogtreecommitdiff
path: root/core/java/android/app/ActivityManager.java
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2017-09-29 05:09:09 -0700
committerWale Ogunwale <ogunwale@google.com>2017-10-11 07:40:46 -0700
commit44f036fd5a5ea3253f8df979898f720edbc1af82 (patch)
tree4eafdaf108cef5c8bd84a07e40b624e34bdc3394 /core/java/android/app/ActivityManager.java
parent9eb155567d911516ed23bad643b47486d6cc6fcd (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/app/ActivityManager.java')
-rw-r--r--core/java/android/app/ActivityManager.java132
1 files changed, 0 insertions, 132 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;
- }
}
/**