Loading services/core/java/com/android/server/am/ActivityRecord.java +13 −3 Original line number Original line Diff line number Diff line Loading @@ -1543,7 +1543,13 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo Slog.e(TAG, "applyOptionsLocked: Unknown animationType=" + animationType); Slog.e(TAG, "applyOptionsLocked: Unknown animationType=" + animationType); break; break; } } pendingOptions = null; if (task == null) { clearOptionsLocked(false /* withAbort */); } else { // This will clear the options for all the ActivityRecords for this Task. task.clearAllPendingOptions(); } } } } } Loading @@ -1552,10 +1558,14 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo } } void clearOptionsLocked() { void clearOptionsLocked() { if (pendingOptions != null) { clearOptionsLocked(true /* withAbort */); } void clearOptionsLocked(boolean withAbort) { if (withAbort && pendingOptions != null) { pendingOptions.abort(); pendingOptions.abort(); pendingOptions = null; } } pendingOptions = null; } } ActivityOptions takeOptionsLocked() { ActivityOptions takeOptionsLocked() { Loading services/core/java/com/android/server/am/ActivityStack.java +8 −9 Original line number Original line Diff line number Diff line Loading @@ -4501,11 +4501,11 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai return hasVisibleActivities; return hasVisibleActivities; } } private void updateTransitLocked(int transit, ActivityRecord starting, private void updateTransitLocked(int transit, ActivityOptions options) { ActivityOptions options) { if (options != null) { if (options != null) { if (starting != null && !starting.isState(RESUMED)) { ActivityRecord r = topRunningActivityLocked(); starting.updateOptionsLocked(options); if (r != null && !r.isState(RESUMED)) { r.updateOptionsLocked(options); } else { } else { ActivityOptions.abort(options); ActivityOptions.abort(options); } } Loading Loading @@ -4542,9 +4542,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } } } } final void moveTaskToFrontLocked(TaskRecord tr, ActivityRecord starting, final void moveTaskToFrontLocked(TaskRecord tr, boolean noAnimation, ActivityOptions options, boolean noAnimation, ActivityOptions options, AppTimeTracker timeTracker, AppTimeTracker timeTracker, String reason) { String reason) { if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "moveTaskToFront: " + tr); if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "moveTaskToFront: " + tr); final ActivityStack topStack = getDisplay().getTopStack(); final ActivityStack topStack = getDisplay().getTopStack(); Loading @@ -4556,7 +4555,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai if (noAnimation) { if (noAnimation) { ActivityOptions.abort(options); ActivityOptions.abort(options); } else { } else { updateTransitLocked(TRANSIT_TASK_TO_FRONT, starting, options); updateTransitLocked(TRANSIT_TASK_TO_FRONT, options); } } return; return; } } Loading Loading @@ -4594,7 +4593,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } } ActivityOptions.abort(options); ActivityOptions.abort(options); } else { } else { updateTransitLocked(TRANSIT_TASK_TO_FRONT, r, options); updateTransitLocked(TRANSIT_TASK_TO_FRONT, options); } } // If a new task is moved to the front, then mark the existing top activity as supporting // If a new task is moved to the front, then mark the existing top activity as supporting // picture-in-picture while paused only if the task would not be considered an oerlay on top // picture-in-picture while paused only if the task would not be considered an oerlay on top Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -2196,7 +2196,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D } } final ActivityRecord r = task.getTopActivity(); final ActivityRecord r = task.getTopActivity(); currentStack.moveTaskToFrontLocked(task, r, false /* noAnimation */, options, currentStack.moveTaskToFrontLocked(task, false /* noAnimation */, options, r == null ? null : r.appTimeTracker, reason); r == null ? null : r.appTimeTracker, reason); if (DEBUG_STACK) Slog.d(TAG_STACK, if (DEBUG_STACK) Slog.d(TAG_STACK, Loading services/core/java/com/android/server/am/ActivityStarter.java +8 −9 Original line number Original line Diff line number Diff line Loading @@ -1815,9 +1815,8 @@ class ActivityStarter { // We only want to move to the front, if we aren't going to launch on a // We only want to move to the front, if we aren't going to launch on a // different stack. If we launch on a different stack, we will put the // different stack. If we launch on a different stack, we will put the // task on top there. // task on top there. mTargetStack.moveTaskToFrontLocked(intentTask, mStartActivity, mNoAnimation, mTargetStack.moveTaskToFrontLocked(intentTask, mNoAnimation, mOptions, mOptions, mStartActivity.appTimeTracker, mStartActivity.appTimeTracker, "bringingFoundTaskToFront"); "bringingFoundTaskToFront"); mMovedToFront = true; mMovedToFront = true; } else if (launchStack.inSplitScreenWindowingMode()) { } else if (launchStack.inSplitScreenWindowingMode()) { if ((mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) { if ((mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) { Loading @@ -1831,7 +1830,7 @@ class ActivityStarter { // We choose to move task to front instead of launching it adjacent // We choose to move task to front instead of launching it adjacent // when specific stack was requested explicitly and it appeared to be // when specific stack was requested explicitly and it appeared to be // adjacent stack, but FLAG_ACTIVITY_LAUNCH_ADJACENT was not set. // adjacent stack, but FLAG_ACTIVITY_LAUNCH_ADJACENT was not set. mTargetStack.moveTaskToFrontLocked(intentTask, mStartActivity, mTargetStack.moveTaskToFrontLocked(intentTask, mNoAnimation, mOptions, mStartActivity.appTimeTracker, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "bringToFrontInsteadOfAdjacentLaunch"); "bringToFrontInsteadOfAdjacentLaunch"); } } Loading Loading @@ -2060,7 +2059,7 @@ class ActivityStarter { final TaskRecord topTask = mTargetStack.topTask(); final TaskRecord topTask = mTargetStack.topTask(); if (topTask != sourceTask && !mAvoidMoveToFront) { if (topTask != sourceTask && !mAvoidMoveToFront) { mTargetStack.moveTaskToFrontLocked(sourceTask, mStartActivity, mNoAnimation, mOptions, mTargetStack.moveTaskToFrontLocked(sourceTask, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "sourceTaskToFront"); mStartActivity.appTimeTracker, "sourceTaskToFront"); } else if (mDoResume) { } else if (mDoResume) { mTargetStack.moveToFront("sourceStackToFront"); mTargetStack.moveToFront("sourceStackToFront"); Loading Loading @@ -2126,7 +2125,7 @@ class ActivityStarter { && top.userId == mStartActivity.userId) { && top.userId == mStartActivity.userId) { if ((mLaunchFlags & FLAG_ACTIVITY_SINGLE_TOP) != 0 if ((mLaunchFlags & FLAG_ACTIVITY_SINGLE_TOP) != 0 || isLaunchModeOneOf(LAUNCH_SINGLE_TOP, LAUNCH_SINGLE_TASK)) { || isLaunchModeOneOf(LAUNCH_SINGLE_TOP, LAUNCH_SINGLE_TASK)) { mTargetStack.moveTaskToFrontLocked(mInTask, mStartActivity, mNoAnimation, mOptions, mTargetStack.moveTaskToFrontLocked(mInTask, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "inTaskToFront"); mStartActivity.appTimeTracker, "inTaskToFront"); if ((mStartFlags & START_FLAG_ONLY_IF_NEEDED) != 0) { if ((mStartFlags & START_FLAG_ONLY_IF_NEEDED) != 0) { // We don't need to start a new activity, and the client said not to do // We don't need to start a new activity, and the client said not to do Loading @@ -2139,7 +2138,7 @@ class ActivityStarter { } } if (!mAddingToTask) { if (!mAddingToTask) { mTargetStack.moveTaskToFrontLocked(mInTask, mStartActivity, mNoAnimation, mOptions, mTargetStack.moveTaskToFrontLocked(mInTask, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "inTaskToFront"); mStartActivity.appTimeTracker, "inTaskToFront"); // We don't actually want to have this activity added to the task, so just // We don't actually want to have this activity added to the task, so just // stop here but still tell the caller that we consumed the intent. // stop here but still tell the caller that we consumed the intent. Loading @@ -2159,8 +2158,8 @@ class ActivityStarter { updateBounds(mInTask, mLaunchParams.mBounds); updateBounds(mInTask, mLaunchParams.mBounds); } } mTargetStack.moveTaskToFrontLocked(mInTask, mStartActivity, mNoAnimation, mOptions, mTargetStack.moveTaskToFrontLocked( mStartActivity.appTimeTracker, "inTaskToFront"); mInTask, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "inTaskToFront"); addOrReparentStartingActivity(mInTask, "setTaskFromInTask"); addOrReparentStartingActivity(mInTask, "setTaskFromInTask"); if (DEBUG_TASKS) Slog.v(TAG_TASKS, "Starting new activity " + mStartActivity if (DEBUG_TASKS) Slog.v(TAG_TASKS, "Starting new activity " + mStartActivity Loading services/core/java/com/android/server/am/TaskRecord.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -944,7 +944,7 @@ class TaskRecord extends ConfigurationContainer implements TaskWindowContainerLi } } @Override @Override protected ConfigurationContainer getChildAt(int index) { protected ActivityRecord getChildAt(int index) { return mActivities.get(index); return mActivities.get(index); } } Loading Loading @@ -1898,6 +1898,12 @@ class TaskRecord extends ConfigurationContainer implements TaskWindowContainerLi } } } } void clearAllPendingOptions() { for (int i = getChildCount() - 1; i >= 0; i--) { getChildAt(i).clearOptionsLocked(false /* withAbort */); } } void dump(PrintWriter pw, String prefix) { void dump(PrintWriter pw, String prefix) { pw.print(prefix); pw.print("userId="); pw.print(userId); pw.print(prefix); pw.print("userId="); pw.print(userId); pw.print(" effectiveUid="); UserHandle.formatUid(pw, effectiveUid); pw.print(" effectiveUid="); UserHandle.formatUid(pw, effectiveUid); Loading Loading
services/core/java/com/android/server/am/ActivityRecord.java +13 −3 Original line number Original line Diff line number Diff line Loading @@ -1543,7 +1543,13 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo Slog.e(TAG, "applyOptionsLocked: Unknown animationType=" + animationType); Slog.e(TAG, "applyOptionsLocked: Unknown animationType=" + animationType); break; break; } } pendingOptions = null; if (task == null) { clearOptionsLocked(false /* withAbort */); } else { // This will clear the options for all the ActivityRecords for this Task. task.clearAllPendingOptions(); } } } } } Loading @@ -1552,10 +1558,14 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo } } void clearOptionsLocked() { void clearOptionsLocked() { if (pendingOptions != null) { clearOptionsLocked(true /* withAbort */); } void clearOptionsLocked(boolean withAbort) { if (withAbort && pendingOptions != null) { pendingOptions.abort(); pendingOptions.abort(); pendingOptions = null; } } pendingOptions = null; } } ActivityOptions takeOptionsLocked() { ActivityOptions takeOptionsLocked() { Loading
services/core/java/com/android/server/am/ActivityStack.java +8 −9 Original line number Original line Diff line number Diff line Loading @@ -4501,11 +4501,11 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai return hasVisibleActivities; return hasVisibleActivities; } } private void updateTransitLocked(int transit, ActivityRecord starting, private void updateTransitLocked(int transit, ActivityOptions options) { ActivityOptions options) { if (options != null) { if (options != null) { if (starting != null && !starting.isState(RESUMED)) { ActivityRecord r = topRunningActivityLocked(); starting.updateOptionsLocked(options); if (r != null && !r.isState(RESUMED)) { r.updateOptionsLocked(options); } else { } else { ActivityOptions.abort(options); ActivityOptions.abort(options); } } Loading Loading @@ -4542,9 +4542,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } } } } final void moveTaskToFrontLocked(TaskRecord tr, ActivityRecord starting, final void moveTaskToFrontLocked(TaskRecord tr, boolean noAnimation, ActivityOptions options, boolean noAnimation, ActivityOptions options, AppTimeTracker timeTracker, AppTimeTracker timeTracker, String reason) { String reason) { if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "moveTaskToFront: " + tr); if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "moveTaskToFront: " + tr); final ActivityStack topStack = getDisplay().getTopStack(); final ActivityStack topStack = getDisplay().getTopStack(); Loading @@ -4556,7 +4555,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai if (noAnimation) { if (noAnimation) { ActivityOptions.abort(options); ActivityOptions.abort(options); } else { } else { updateTransitLocked(TRANSIT_TASK_TO_FRONT, starting, options); updateTransitLocked(TRANSIT_TASK_TO_FRONT, options); } } return; return; } } Loading Loading @@ -4594,7 +4593,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } } ActivityOptions.abort(options); ActivityOptions.abort(options); } else { } else { updateTransitLocked(TRANSIT_TASK_TO_FRONT, r, options); updateTransitLocked(TRANSIT_TASK_TO_FRONT, options); } } // If a new task is moved to the front, then mark the existing top activity as supporting // If a new task is moved to the front, then mark the existing top activity as supporting // picture-in-picture while paused only if the task would not be considered an oerlay on top // picture-in-picture while paused only if the task would not be considered an oerlay on top Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -2196,7 +2196,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D } } final ActivityRecord r = task.getTopActivity(); final ActivityRecord r = task.getTopActivity(); currentStack.moveTaskToFrontLocked(task, r, false /* noAnimation */, options, currentStack.moveTaskToFrontLocked(task, false /* noAnimation */, options, r == null ? null : r.appTimeTracker, reason); r == null ? null : r.appTimeTracker, reason); if (DEBUG_STACK) Slog.d(TAG_STACK, if (DEBUG_STACK) Slog.d(TAG_STACK, Loading
services/core/java/com/android/server/am/ActivityStarter.java +8 −9 Original line number Original line Diff line number Diff line Loading @@ -1815,9 +1815,8 @@ class ActivityStarter { // We only want to move to the front, if we aren't going to launch on a // We only want to move to the front, if we aren't going to launch on a // different stack. If we launch on a different stack, we will put the // different stack. If we launch on a different stack, we will put the // task on top there. // task on top there. mTargetStack.moveTaskToFrontLocked(intentTask, mStartActivity, mNoAnimation, mTargetStack.moveTaskToFrontLocked(intentTask, mNoAnimation, mOptions, mOptions, mStartActivity.appTimeTracker, mStartActivity.appTimeTracker, "bringingFoundTaskToFront"); "bringingFoundTaskToFront"); mMovedToFront = true; mMovedToFront = true; } else if (launchStack.inSplitScreenWindowingMode()) { } else if (launchStack.inSplitScreenWindowingMode()) { if ((mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) { if ((mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) { Loading @@ -1831,7 +1830,7 @@ class ActivityStarter { // We choose to move task to front instead of launching it adjacent // We choose to move task to front instead of launching it adjacent // when specific stack was requested explicitly and it appeared to be // when specific stack was requested explicitly and it appeared to be // adjacent stack, but FLAG_ACTIVITY_LAUNCH_ADJACENT was not set. // adjacent stack, but FLAG_ACTIVITY_LAUNCH_ADJACENT was not set. mTargetStack.moveTaskToFrontLocked(intentTask, mStartActivity, mTargetStack.moveTaskToFrontLocked(intentTask, mNoAnimation, mOptions, mStartActivity.appTimeTracker, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "bringToFrontInsteadOfAdjacentLaunch"); "bringToFrontInsteadOfAdjacentLaunch"); } } Loading Loading @@ -2060,7 +2059,7 @@ class ActivityStarter { final TaskRecord topTask = mTargetStack.topTask(); final TaskRecord topTask = mTargetStack.topTask(); if (topTask != sourceTask && !mAvoidMoveToFront) { if (topTask != sourceTask && !mAvoidMoveToFront) { mTargetStack.moveTaskToFrontLocked(sourceTask, mStartActivity, mNoAnimation, mOptions, mTargetStack.moveTaskToFrontLocked(sourceTask, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "sourceTaskToFront"); mStartActivity.appTimeTracker, "sourceTaskToFront"); } else if (mDoResume) { } else if (mDoResume) { mTargetStack.moveToFront("sourceStackToFront"); mTargetStack.moveToFront("sourceStackToFront"); Loading Loading @@ -2126,7 +2125,7 @@ class ActivityStarter { && top.userId == mStartActivity.userId) { && top.userId == mStartActivity.userId) { if ((mLaunchFlags & FLAG_ACTIVITY_SINGLE_TOP) != 0 if ((mLaunchFlags & FLAG_ACTIVITY_SINGLE_TOP) != 0 || isLaunchModeOneOf(LAUNCH_SINGLE_TOP, LAUNCH_SINGLE_TASK)) { || isLaunchModeOneOf(LAUNCH_SINGLE_TOP, LAUNCH_SINGLE_TASK)) { mTargetStack.moveTaskToFrontLocked(mInTask, mStartActivity, mNoAnimation, mOptions, mTargetStack.moveTaskToFrontLocked(mInTask, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "inTaskToFront"); mStartActivity.appTimeTracker, "inTaskToFront"); if ((mStartFlags & START_FLAG_ONLY_IF_NEEDED) != 0) { if ((mStartFlags & START_FLAG_ONLY_IF_NEEDED) != 0) { // We don't need to start a new activity, and the client said not to do // We don't need to start a new activity, and the client said not to do Loading @@ -2139,7 +2138,7 @@ class ActivityStarter { } } if (!mAddingToTask) { if (!mAddingToTask) { mTargetStack.moveTaskToFrontLocked(mInTask, mStartActivity, mNoAnimation, mOptions, mTargetStack.moveTaskToFrontLocked(mInTask, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "inTaskToFront"); mStartActivity.appTimeTracker, "inTaskToFront"); // We don't actually want to have this activity added to the task, so just // We don't actually want to have this activity added to the task, so just // stop here but still tell the caller that we consumed the intent. // stop here but still tell the caller that we consumed the intent. Loading @@ -2159,8 +2158,8 @@ class ActivityStarter { updateBounds(mInTask, mLaunchParams.mBounds); updateBounds(mInTask, mLaunchParams.mBounds); } } mTargetStack.moveTaskToFrontLocked(mInTask, mStartActivity, mNoAnimation, mOptions, mTargetStack.moveTaskToFrontLocked( mStartActivity.appTimeTracker, "inTaskToFront"); mInTask, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "inTaskToFront"); addOrReparentStartingActivity(mInTask, "setTaskFromInTask"); addOrReparentStartingActivity(mInTask, "setTaskFromInTask"); if (DEBUG_TASKS) Slog.v(TAG_TASKS, "Starting new activity " + mStartActivity if (DEBUG_TASKS) Slog.v(TAG_TASKS, "Starting new activity " + mStartActivity Loading
services/core/java/com/android/server/am/TaskRecord.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -944,7 +944,7 @@ class TaskRecord extends ConfigurationContainer implements TaskWindowContainerLi } } @Override @Override protected ConfigurationContainer getChildAt(int index) { protected ActivityRecord getChildAt(int index) { return mActivities.get(index); return mActivities.get(index); } } Loading Loading @@ -1898,6 +1898,12 @@ class TaskRecord extends ConfigurationContainer implements TaskWindowContainerLi } } } } void clearAllPendingOptions() { for (int i = getChildCount() - 1; i >= 0; i--) { getChildAt(i).clearOptionsLocked(false /* withAbort */); } } void dump(PrintWriter pw, String prefix) { void dump(PrintWriter pw, String prefix) { pw.print(prefix); pw.print("userId="); pw.print(userId); pw.print(prefix); pw.print("userId="); pw.print(userId); pw.print(" effectiveUid="); UserHandle.formatUid(pw, effectiveUid); pw.print(" effectiveUid="); UserHandle.formatUid(pw, effectiveUid); Loading