Loading core/java/android/app/ActivityOptions.java +21 −3 Original line number Diff line number Diff line Loading @@ -176,6 +176,13 @@ public class ActivityOptions { */ private static final String KEY_TASK_OVERLAY = "android.activity.taskOverlay"; /** * See {@link #setTaskOverlay}. * @hide */ private static final String KEY_TASK_OVERLAY_CAN_RESUME = "android.activity.taskOverlayCanResume"; /** * Where the docked stack should be positioned. * @hide Loading Loading @@ -252,6 +259,7 @@ public class ActivityOptions { private int mLaunchTaskId = -1; private int mDockCreateMode = DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT; private boolean mTaskOverlay; private boolean mTaskOverlayCanResume; private AppTransitionAnimationSpec mAnimSpecs[]; private int mRotationAnimationHint = -1; Loading Loading @@ -862,6 +870,7 @@ public class ActivityOptions { mLaunchStackId = opts.getInt(KEY_LAUNCH_STACK_ID, INVALID_STACK_ID); mLaunchTaskId = opts.getInt(KEY_LAUNCH_TASK_ID, -1); mTaskOverlay = opts.getBoolean(KEY_TASK_OVERLAY, false); mTaskOverlayCanResume = opts.getBoolean(KEY_TASK_OVERLAY_CAN_RESUME, false); mDockCreateMode = opts.getInt(KEY_DOCK_CREATE_MODE, DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT); if (opts.containsKey(KEY_ANIM_SPECS)) { Parcelable[] specs = opts.getParcelableArray(KEY_ANIM_SPECS); Loading Loading @@ -1071,12 +1080,13 @@ public class ActivityOptions { /** * Set's whether the activity launched with this option should be a task overlay. That is the * activity will always be the top activity of the task and doesn't cause the task to be moved * to the front when it is added. * activity will always be the top activity of the task. If {@param canResume} is true, then * the task will also not be moved to the front of the stack. * @hide */ public void setTaskOverlay(boolean taskOverlay) { public void setTaskOverlay(boolean taskOverlay, boolean canResume) { mTaskOverlay = taskOverlay; mTaskOverlayCanResume = canResume; } /** Loading @@ -1086,6 +1096,13 @@ public class ActivityOptions { return mTaskOverlay; } /** * @hide */ public boolean canTaskOverlayResume() { return mTaskOverlayCanResume; } /** @hide */ public int getDockCreateMode() { return mDockCreateMode; Loading Loading @@ -1241,6 +1258,7 @@ public class ActivityOptions { b.putInt(KEY_LAUNCH_STACK_ID, mLaunchStackId); b.putInt(KEY_LAUNCH_TASK_ID, mLaunchTaskId); b.putBoolean(KEY_TASK_OVERLAY, mTaskOverlay); b.putBoolean(KEY_TASK_OVERLAY_CAN_RESUME, mTaskOverlayCanResume); b.putInt(KEY_DOCK_CREATE_MODE, mDockCreateMode); if (mAnimSpecs != null) { b.putParcelableArray(KEY_ANIM_SPECS, mAnimSpecs); Loading packages/SystemUI/src/com/android/systemui/keyguard/WorkLockActivityController.java +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class WorkLockActivityController { final ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchTaskId(taskId); options.setTaskOverlay(true); options.setTaskOverlay(true, false /* canResume */); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); } Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java +1 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,7 @@ public class PipMenuActivityController { ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0); options.setLaunchTaskId( pinnedStackInfo.taskIds[pinnedStackInfo.taskIds.length - 1]); options.setTaskOverlay(true); options.setTaskOverlay(true, true /* canResume */); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); } else { Log.e(TAG, "No PIP tasks found"); Loading packages/SystemUI/src/com/android/systemui/stackdivider/ForcedResizableInfoActivityController.java +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ public class ForcedResizableInfoActivityController { Intent intent = new Intent(mContext, ForcedResizableInfoActivity.class); ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchTaskId(mPendingTaskIds.valueAt(i)); options.setTaskOverlay(true); options.setTaskOverlay(true, false /* canResume */); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); } mPendingTaskIds.clear(); Loading services/core/java/com/android/server/am/ActivityStarter.java +12 −9 Original line number Diff line number Diff line Loading @@ -1236,18 +1236,21 @@ class ActivityStarter { mDoResume = false; } if (mOptions != null && mOptions.getLaunchTaskId() != -1 && mOptions.getTaskOverlay()) { if (mOptions != null && mOptions.getLaunchTaskId() != -1 && mOptions.getTaskOverlay()) { r.mTaskOverlay = true; if (!mOptions.canTaskOverlayResume()) { final TaskRecord task = mSupervisor.anyTaskForIdLocked(mOptions.getLaunchTaskId()); final ActivityRecord top = task != null ? task.getTopActivity() : null; if (top != null && top.state != RESUMED) { // The caller specifies that we'd like to be avoided to be moved to the front, so be // it! // The caller specifies that we'd like to be avoided to be moved to the front, // so be it! mDoResume = false; mAvoidMoveToFront = true; } } } mNotTop = (mLaunchFlags & FLAG_ACTIVITY_PREVIOUS_IS_TOP) != 0 ? r : null; Loading Loading
core/java/android/app/ActivityOptions.java +21 −3 Original line number Diff line number Diff line Loading @@ -176,6 +176,13 @@ public class ActivityOptions { */ private static final String KEY_TASK_OVERLAY = "android.activity.taskOverlay"; /** * See {@link #setTaskOverlay}. * @hide */ private static final String KEY_TASK_OVERLAY_CAN_RESUME = "android.activity.taskOverlayCanResume"; /** * Where the docked stack should be positioned. * @hide Loading Loading @@ -252,6 +259,7 @@ public class ActivityOptions { private int mLaunchTaskId = -1; private int mDockCreateMode = DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT; private boolean mTaskOverlay; private boolean mTaskOverlayCanResume; private AppTransitionAnimationSpec mAnimSpecs[]; private int mRotationAnimationHint = -1; Loading Loading @@ -862,6 +870,7 @@ public class ActivityOptions { mLaunchStackId = opts.getInt(KEY_LAUNCH_STACK_ID, INVALID_STACK_ID); mLaunchTaskId = opts.getInt(KEY_LAUNCH_TASK_ID, -1); mTaskOverlay = opts.getBoolean(KEY_TASK_OVERLAY, false); mTaskOverlayCanResume = opts.getBoolean(KEY_TASK_OVERLAY_CAN_RESUME, false); mDockCreateMode = opts.getInt(KEY_DOCK_CREATE_MODE, DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT); if (opts.containsKey(KEY_ANIM_SPECS)) { Parcelable[] specs = opts.getParcelableArray(KEY_ANIM_SPECS); Loading Loading @@ -1071,12 +1080,13 @@ public class ActivityOptions { /** * Set's whether the activity launched with this option should be a task overlay. That is the * activity will always be the top activity of the task and doesn't cause the task to be moved * to the front when it is added. * activity will always be the top activity of the task. If {@param canResume} is true, then * the task will also not be moved to the front of the stack. * @hide */ public void setTaskOverlay(boolean taskOverlay) { public void setTaskOverlay(boolean taskOverlay, boolean canResume) { mTaskOverlay = taskOverlay; mTaskOverlayCanResume = canResume; } /** Loading @@ -1086,6 +1096,13 @@ public class ActivityOptions { return mTaskOverlay; } /** * @hide */ public boolean canTaskOverlayResume() { return mTaskOverlayCanResume; } /** @hide */ public int getDockCreateMode() { return mDockCreateMode; Loading Loading @@ -1241,6 +1258,7 @@ public class ActivityOptions { b.putInt(KEY_LAUNCH_STACK_ID, mLaunchStackId); b.putInt(KEY_LAUNCH_TASK_ID, mLaunchTaskId); b.putBoolean(KEY_TASK_OVERLAY, mTaskOverlay); b.putBoolean(KEY_TASK_OVERLAY_CAN_RESUME, mTaskOverlayCanResume); b.putInt(KEY_DOCK_CREATE_MODE, mDockCreateMode); if (mAnimSpecs != null) { b.putParcelableArray(KEY_ANIM_SPECS, mAnimSpecs); Loading
packages/SystemUI/src/com/android/systemui/keyguard/WorkLockActivityController.java +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class WorkLockActivityController { final ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchTaskId(taskId); options.setTaskOverlay(true); options.setTaskOverlay(true, false /* canResume */); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); } Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java +1 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,7 @@ public class PipMenuActivityController { ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0); options.setLaunchTaskId( pinnedStackInfo.taskIds[pinnedStackInfo.taskIds.length - 1]); options.setTaskOverlay(true); options.setTaskOverlay(true, true /* canResume */); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); } else { Log.e(TAG, "No PIP tasks found"); Loading
packages/SystemUI/src/com/android/systemui/stackdivider/ForcedResizableInfoActivityController.java +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ public class ForcedResizableInfoActivityController { Intent intent = new Intent(mContext, ForcedResizableInfoActivity.class); ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchTaskId(mPendingTaskIds.valueAt(i)); options.setTaskOverlay(true); options.setTaskOverlay(true, false /* canResume */); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); } mPendingTaskIds.clear(); Loading
services/core/java/com/android/server/am/ActivityStarter.java +12 −9 Original line number Diff line number Diff line Loading @@ -1236,18 +1236,21 @@ class ActivityStarter { mDoResume = false; } if (mOptions != null && mOptions.getLaunchTaskId() != -1 && mOptions.getTaskOverlay()) { if (mOptions != null && mOptions.getLaunchTaskId() != -1 && mOptions.getTaskOverlay()) { r.mTaskOverlay = true; if (!mOptions.canTaskOverlayResume()) { final TaskRecord task = mSupervisor.anyTaskForIdLocked(mOptions.getLaunchTaskId()); final ActivityRecord top = task != null ? task.getTopActivity() : null; if (top != null && top.state != RESUMED) { // The caller specifies that we'd like to be avoided to be moved to the front, so be // it! // The caller specifies that we'd like to be avoided to be moved to the front, // so be it! mDoResume = false; mAvoidMoveToFront = true; } } } mNotTop = (mLaunchFlags & FLAG_ACTIVITY_PREVIOUS_IS_TOP) != 0 ? r : null; Loading