Loading services/core/java/com/android/server/wm/ActivityRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -4358,7 +4358,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final boolean isDisplaySleeping = getDisplay().isSleeping() && getDisplayId() != DEFAULT_DISPLAY; // Whether this activity is the top activity of this stack. final boolean isTop = this == stack.getTopActivity(); final boolean isTop = this == stack.getTopNonFinishingActivity(); // Exclude the case where this is the top activity in a pinned stack. final boolean isTopNotPinnedStack = stack.isAttached() && stack.getDisplay().isTopNotPinnedStack(stack); Loading services/core/java/com/android/server/wm/ActivityStack.java +11 −10 Original line number Diff line number Diff line Loading @@ -794,7 +794,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg return; } final ActivityRecord topActivity = getTopActivity(); final ActivityRecord topActivity = getTopNonFinishingActivity(); // For now, assume that the Stack's windowing mode is what will actually be used // by it's activities. In the future, there may be situations where this doesn't Loading Loading @@ -1041,9 +1041,9 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg return null; } ActivityRecord getTopActivity() { ActivityRecord getTopNonFinishingActivity() { for (int taskNdx = getChildCount() - 1; taskNdx >= 0; --taskNdx) { final ActivityRecord r = getChildAt(taskNdx).getTopActivity(); final ActivityRecord r = getChildAt(taskNdx).getTopNonFinishingActivity(); if (r != null) { return r; } Loading Loading @@ -1264,7 +1264,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg } // Overlays should not be considered as the task's logical top activity. final ActivityRecord r = task.getTopActivity(false /* includeOverlays */); final ActivityRecord r = task.getTopNonFinishingActivity(false /* includeOverlays */); if (r == null || r.finishing || r.mUserId != userId || r.launchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE) { if (DEBUG_TASKS) Slog.d(TAG_TASKS, "Skipping " + task + ": mismatch root " + r); Loading Loading @@ -1823,7 +1823,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg } boolean isTopActivityVisible() { final ActivityRecord topActivity = getTopActivity(); final ActivityRecord topActivity = getTopNonFinishingActivity(); return topActivity != null && topActivity.visible; } Loading Loading @@ -2899,7 +2899,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg boolean startIt = true; for (int taskNdx = getChildCount() - 1; taskNdx >= 0; --taskNdx) { task = getChildAt(taskNdx); if (task.getTopActivity() == null) { if (task.getTopNonFinishingActivity() == null) { // All activities in task are finishing. continue; } Loading Loading @@ -3380,7 +3380,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg int taskNdx = mChildren.indexOf(task); if (taskNdx >= 0) { ActivityRecord newTop = getChildAt(taskNdx).getTopActivity(); ActivityRecord newTop = getChildAt(taskNdx).getTopNonFinishingActivity(); if (newTop != null) { taskTop = newTop; } Loading Loading @@ -4002,7 +4002,8 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "moveTaskToFront: " + tr); final ActivityStack topStack = getDisplay().getTopStack(); final ActivityRecord topActivity = topStack != null ? topStack.getTopActivity() : null; final ActivityRecord topActivity = topStack != null ? topStack.getTopNonFinishingActivity() : null; final int numTasks = getChildCount(); final int index = mChildren.indexOf(tr); if (numTasks == 0 || index < 0) { Loading Loading @@ -4033,7 +4034,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg positionChildAtTop(tr); // Don't refocus if invisible to current user final ActivityRecord top = tr.getTopActivity(); final ActivityRecord top = tr.getTopNonFinishingActivity(); if (top == null || !top.okToShowLocked()) { if (top != null) { mStackSupervisor.mRecentTasks.add(top.getTask()); Loading Loading @@ -4352,7 +4353,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg int userId = UserHandle.getUserId(callingUid); for (int taskNdx = getChildCount() - 1; taskNdx >= 0; --taskNdx) { final Task task = getChildAt(taskNdx); if (task.getTopActivity() == null) { if (task.getTopNonFinishingActivity() == null) { // Skip if there are no activities in the task continue; } Loading services/core/java/com/android/server/wm/ActivityStackSupervisor.java +5 −5 Original line number Diff line number Diff line Loading @@ -1428,7 +1428,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { moveHomeStackToFrontIfNeeded(flags, currentStack.getDisplay(), reason); } final ActivityRecord r = task.getTopActivity(); final ActivityRecord r = task.getTopNonFinishingActivity(); currentStack.moveTaskToFrontLocked(task, false /* noAnimation */, options, r == null ? null : r.appTimeTracker, reason); Loading Loading @@ -2077,7 +2077,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // When launching tasks behind, update the last active time of the top task after the new // task has been shown briefly final ActivityRecord top = stack.getTopActivity(); final ActivityRecord top = stack.getTopNonFinishingActivity(); if (top != null) { top.getTask().touchActiveTime(); } Loading Loading @@ -2458,7 +2458,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { /** Notifies that the top activity of the task is forced to be resizeable. */ private void handleForcedResizableTaskIfNeeded(Task task, int reason) { final ActivityRecord topActivity = task.getTopActivity(); final ActivityRecord topActivity = task.getTopNonFinishingActivity(); if (topActivity == null || topActivity.noDisplay || !topActivity.isNonResizableOrForcedResizable(task.getWindowingMode())) { return; Loading Loading @@ -2750,7 +2750,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // Work Challenge is present) let startActivityInPackage handle the intercepting. if (!mService.mAmInternal.shouldConfirmCredentials(task.mUserId) && task.getRootActivity() != null) { final ActivityRecord targetActivity = task.getTopActivity(); final ActivityRecord targetActivity = task.getTopNonFinishingActivity(); mRootActivityContainer.sendPowerHintForLaunchStartIfNeeded( true /* forceSend */, targetActivity); Loading @@ -2767,7 +2767,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { } mService.getActivityStartController().postStartActivityProcessingForLastStarter( task.getTopActivity(), ActivityManager.START_TASK_TO_FRONT, task.getTopNonFinishingActivity(), ActivityManager.START_TASK_TO_FRONT, task.getStack()); return ActivityManager.START_TASK_TO_FRONT; } Loading services/core/java/com/android/server/wm/ActivityStarter.java +13 −10 Original line number Diff line number Diff line Loading @@ -1502,7 +1502,8 @@ class ActivityStarter { return startResult; } final ActivityRecord targetTaskTop = newTask ? null : targetTask.getTopActivity(); final ActivityRecord targetTaskTop = newTask ? null : targetTask.getTopNonFinishingActivity(); if (targetTaskTop != null) { // Recycle the target task for this launch. startResult = recycleTask(targetTask, targetTaskTop, reusedTask); Loading Loading @@ -1559,8 +1560,8 @@ class ActivityStarter { mRootActivityContainer.sendPowerHintForLaunchStartIfNeeded( false /* forceSend */, mStartActivity); mTargetStack.startActivityLocked(mStartActivity, topStack.getTopActivity(), newTask, mKeepCurTransition, mOptions); mTargetStack.startActivityLocked(mStartActivity, topStack.getTopNonFinishingActivity(), newTask, mKeepCurTransition, mOptions); if (mDoResume) { final ActivityRecord topTaskActivity = mStartActivity.getTask().topRunningActivityLocked(); Loading Loading @@ -1612,7 +1613,7 @@ class ActivityStarter { return mInTask; } else { final ActivityRecord top = computeStackFocus(mStartActivity, false /* newTask */, mLaunchFlags, mOptions).getTopActivity(); mLaunchFlags, mOptions).getTopNonFinishingActivity(); if (top != null) { return top.getTask(); } Loading Loading @@ -1727,7 +1728,8 @@ class ActivityStarter { return START_RETURN_INTENT_TO_CALLER; } complyActivityFlags(targetTask, reusedTask != null ? reusedTask.getTopActivity() : null); complyActivityFlags(targetTask, reusedTask != null ? reusedTask.getTopNonFinishingActivity() : null); if (clearTaskForReuse) { // Clear task for re-use so later code to methods Loading Loading @@ -1755,7 +1757,7 @@ class ActivityStarter { // FLAG_ACTIVITY_CLEAR_TOP flag. In that case, return the top running activity in the // task instead. mLastStartActivityRecord = targetTaskTop.finishing ? targetTask.getTopActivity() : targetTaskTop; targetTaskTop.finishing ? targetTask.getTopNonFinishingActivity() : targetTaskTop; return mMovedToFront ? START_TASK_TO_FRONT : START_DELIVERED_TO_TOP; } Loading Loading @@ -1806,7 +1808,7 @@ class ActivityStarter { * task. */ private void complyActivityFlags(Task targetTask, ActivityRecord reusedActivity) { ActivityRecord targetTaskTop = targetTask.getTopActivity(); ActivityRecord targetTaskTop = targetTask.getTopNonFinishingActivity(); final boolean resetTask = reusedActivity != null && (mLaunchFlags & FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) != 0; if (resetTask) { Loading Loading @@ -2037,7 +2039,8 @@ class ActivityStarter { if (!mOptions.canTaskOverlayResume()) { final Task task = mRootActivityContainer.anyTaskForId( mOptions.getLaunchTaskId()); final ActivityRecord top = task != null ? task.getTopActivity() : null; final ActivityRecord top = task != null ? task.getTopNonFinishingActivity() : null; if (top != null && !top.isState(RESUMED)) { // The caller specifies that we'd like to be avoided to be moved to the Loading Loading @@ -2295,8 +2298,8 @@ class ActivityStarter { if (differentTopTask && !mAvoidMoveToFront) { mStartActivity.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); if (mSourceRecord == null || (mSourceStack.getTopActivity() != null && mSourceStack.getTopActivity().getTask() if (mSourceRecord == null || (mSourceStack.getTopNonFinishingActivity() != null && mSourceStack.getTopNonFinishingActivity().getTask() == mSourceRecord.getTask())) { // We really do want to push this one into the user's face, right now. if (mLaunchTaskBehind && mSourceRecord != null) { Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +7 −7 Original line number Diff line number Diff line Loading @@ -2410,7 +2410,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mStackSupervisor.findTaskToMoveToFront(task, flags, realOptions, "moveTaskToFront", false /* forceNonResizable */); final ActivityRecord topActivity = task.getTopActivity(); final ActivityRecord topActivity = task.getTopNonFinishingActivity(); if (topActivity != null) { // We are reshowing a task, use a starting window to hide the initial draw delay Loading Loading @@ -2999,7 +2999,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { public boolean isTopOfTask(IBinder token) { synchronized (mGlobalLock) { ActivityRecord r = ActivityRecord.isInStackLocked(token); return r != null && r.getTask().getTopActivity() == r; return r != null && r.getTask().getTopNonFinishingActivity() == r; } } Loading Loading @@ -3589,7 +3589,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { "enqueueAssistContext()"); synchronized (mGlobalLock) { ActivityRecord activity = getTopDisplayFocusedStack().getTopActivity(); ActivityRecord activity = getTopDisplayFocusedStack().getTopNonFinishingActivity(); if (activity == null) { Slog.w(TAG, "getAssistContextExtras failed: no top activity"); return null; Loading Loading @@ -3722,7 +3722,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { return false; } final ActivityRecord activity = focusedStack.getTopActivity(); final ActivityRecord activity = focusedStack.getTopNonFinishingActivity(); if (activity == null) { return false; } Loading @@ -3737,7 +3737,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { try { synchronized (mGlobalLock) { ActivityRecord caller = ActivityRecord.forTokenLocked(token); ActivityRecord top = getTopDisplayFocusedStack().getTopActivity(); ActivityRecord top = getTopDisplayFocusedStack().getTopNonFinishingActivity(); if (top != caller) { Slog.w(TAG, "showAssistFromActivity failed: caller " + caller + " is not current top " + top); Loading Loading @@ -4355,7 +4355,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options) { Slog.i(TAG, "Activity tried to startLocalVoiceInteraction"); synchronized (mGlobalLock) { ActivityRecord activity = getTopDisplayFocusedStack().getTopActivity(); ActivityRecord activity = getTopDisplayFocusedStack().getTopNonFinishingActivity(); if (ActivityRecord.forTokenLocked(callingActivity) != activity) { throw new SecurityException("Only focused activity can call startVoiceInteraction"); } Loading Loading @@ -6576,7 +6576,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { + " Requested task not found"); return null; } final ActivityRecord activity = task.getTopActivity(); final ActivityRecord activity = task.getTopNonFinishingActivity(); if (activity == null) { Slog.w(TAG, "getApplicationThreadForTopActivity failed:" + " Requested activity not found"); Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -4358,7 +4358,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final boolean isDisplaySleeping = getDisplay().isSleeping() && getDisplayId() != DEFAULT_DISPLAY; // Whether this activity is the top activity of this stack. final boolean isTop = this == stack.getTopActivity(); final boolean isTop = this == stack.getTopNonFinishingActivity(); // Exclude the case where this is the top activity in a pinned stack. final boolean isTopNotPinnedStack = stack.isAttached() && stack.getDisplay().isTopNotPinnedStack(stack); Loading
services/core/java/com/android/server/wm/ActivityStack.java +11 −10 Original line number Diff line number Diff line Loading @@ -794,7 +794,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg return; } final ActivityRecord topActivity = getTopActivity(); final ActivityRecord topActivity = getTopNonFinishingActivity(); // For now, assume that the Stack's windowing mode is what will actually be used // by it's activities. In the future, there may be situations where this doesn't Loading Loading @@ -1041,9 +1041,9 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg return null; } ActivityRecord getTopActivity() { ActivityRecord getTopNonFinishingActivity() { for (int taskNdx = getChildCount() - 1; taskNdx >= 0; --taskNdx) { final ActivityRecord r = getChildAt(taskNdx).getTopActivity(); final ActivityRecord r = getChildAt(taskNdx).getTopNonFinishingActivity(); if (r != null) { return r; } Loading Loading @@ -1264,7 +1264,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg } // Overlays should not be considered as the task's logical top activity. final ActivityRecord r = task.getTopActivity(false /* includeOverlays */); final ActivityRecord r = task.getTopNonFinishingActivity(false /* includeOverlays */); if (r == null || r.finishing || r.mUserId != userId || r.launchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE) { if (DEBUG_TASKS) Slog.d(TAG_TASKS, "Skipping " + task + ": mismatch root " + r); Loading Loading @@ -1823,7 +1823,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg } boolean isTopActivityVisible() { final ActivityRecord topActivity = getTopActivity(); final ActivityRecord topActivity = getTopNonFinishingActivity(); return topActivity != null && topActivity.visible; } Loading Loading @@ -2899,7 +2899,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg boolean startIt = true; for (int taskNdx = getChildCount() - 1; taskNdx >= 0; --taskNdx) { task = getChildAt(taskNdx); if (task.getTopActivity() == null) { if (task.getTopNonFinishingActivity() == null) { // All activities in task are finishing. continue; } Loading Loading @@ -3380,7 +3380,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg int taskNdx = mChildren.indexOf(task); if (taskNdx >= 0) { ActivityRecord newTop = getChildAt(taskNdx).getTopActivity(); ActivityRecord newTop = getChildAt(taskNdx).getTopNonFinishingActivity(); if (newTop != null) { taskTop = newTop; } Loading Loading @@ -4002,7 +4002,8 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "moveTaskToFront: " + tr); final ActivityStack topStack = getDisplay().getTopStack(); final ActivityRecord topActivity = topStack != null ? topStack.getTopActivity() : null; final ActivityRecord topActivity = topStack != null ? topStack.getTopNonFinishingActivity() : null; final int numTasks = getChildCount(); final int index = mChildren.indexOf(tr); if (numTasks == 0 || index < 0) { Loading Loading @@ -4033,7 +4034,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg positionChildAtTop(tr); // Don't refocus if invisible to current user final ActivityRecord top = tr.getTopActivity(); final ActivityRecord top = tr.getTopNonFinishingActivity(); if (top == null || !top.okToShowLocked()) { if (top != null) { mStackSupervisor.mRecentTasks.add(top.getTask()); Loading Loading @@ -4352,7 +4353,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg int userId = UserHandle.getUserId(callingUid); for (int taskNdx = getChildCount() - 1; taskNdx >= 0; --taskNdx) { final Task task = getChildAt(taskNdx); if (task.getTopActivity() == null) { if (task.getTopNonFinishingActivity() == null) { // Skip if there are no activities in the task continue; } Loading
services/core/java/com/android/server/wm/ActivityStackSupervisor.java +5 −5 Original line number Diff line number Diff line Loading @@ -1428,7 +1428,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { moveHomeStackToFrontIfNeeded(flags, currentStack.getDisplay(), reason); } final ActivityRecord r = task.getTopActivity(); final ActivityRecord r = task.getTopNonFinishingActivity(); currentStack.moveTaskToFrontLocked(task, false /* noAnimation */, options, r == null ? null : r.appTimeTracker, reason); Loading Loading @@ -2077,7 +2077,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // When launching tasks behind, update the last active time of the top task after the new // task has been shown briefly final ActivityRecord top = stack.getTopActivity(); final ActivityRecord top = stack.getTopNonFinishingActivity(); if (top != null) { top.getTask().touchActiveTime(); } Loading Loading @@ -2458,7 +2458,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { /** Notifies that the top activity of the task is forced to be resizeable. */ private void handleForcedResizableTaskIfNeeded(Task task, int reason) { final ActivityRecord topActivity = task.getTopActivity(); final ActivityRecord topActivity = task.getTopNonFinishingActivity(); if (topActivity == null || topActivity.noDisplay || !topActivity.isNonResizableOrForcedResizable(task.getWindowingMode())) { return; Loading Loading @@ -2750,7 +2750,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // Work Challenge is present) let startActivityInPackage handle the intercepting. if (!mService.mAmInternal.shouldConfirmCredentials(task.mUserId) && task.getRootActivity() != null) { final ActivityRecord targetActivity = task.getTopActivity(); final ActivityRecord targetActivity = task.getTopNonFinishingActivity(); mRootActivityContainer.sendPowerHintForLaunchStartIfNeeded( true /* forceSend */, targetActivity); Loading @@ -2767,7 +2767,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { } mService.getActivityStartController().postStartActivityProcessingForLastStarter( task.getTopActivity(), ActivityManager.START_TASK_TO_FRONT, task.getTopNonFinishingActivity(), ActivityManager.START_TASK_TO_FRONT, task.getStack()); return ActivityManager.START_TASK_TO_FRONT; } Loading
services/core/java/com/android/server/wm/ActivityStarter.java +13 −10 Original line number Diff line number Diff line Loading @@ -1502,7 +1502,8 @@ class ActivityStarter { return startResult; } final ActivityRecord targetTaskTop = newTask ? null : targetTask.getTopActivity(); final ActivityRecord targetTaskTop = newTask ? null : targetTask.getTopNonFinishingActivity(); if (targetTaskTop != null) { // Recycle the target task for this launch. startResult = recycleTask(targetTask, targetTaskTop, reusedTask); Loading Loading @@ -1559,8 +1560,8 @@ class ActivityStarter { mRootActivityContainer.sendPowerHintForLaunchStartIfNeeded( false /* forceSend */, mStartActivity); mTargetStack.startActivityLocked(mStartActivity, topStack.getTopActivity(), newTask, mKeepCurTransition, mOptions); mTargetStack.startActivityLocked(mStartActivity, topStack.getTopNonFinishingActivity(), newTask, mKeepCurTransition, mOptions); if (mDoResume) { final ActivityRecord topTaskActivity = mStartActivity.getTask().topRunningActivityLocked(); Loading Loading @@ -1612,7 +1613,7 @@ class ActivityStarter { return mInTask; } else { final ActivityRecord top = computeStackFocus(mStartActivity, false /* newTask */, mLaunchFlags, mOptions).getTopActivity(); mLaunchFlags, mOptions).getTopNonFinishingActivity(); if (top != null) { return top.getTask(); } Loading Loading @@ -1727,7 +1728,8 @@ class ActivityStarter { return START_RETURN_INTENT_TO_CALLER; } complyActivityFlags(targetTask, reusedTask != null ? reusedTask.getTopActivity() : null); complyActivityFlags(targetTask, reusedTask != null ? reusedTask.getTopNonFinishingActivity() : null); if (clearTaskForReuse) { // Clear task for re-use so later code to methods Loading Loading @@ -1755,7 +1757,7 @@ class ActivityStarter { // FLAG_ACTIVITY_CLEAR_TOP flag. In that case, return the top running activity in the // task instead. mLastStartActivityRecord = targetTaskTop.finishing ? targetTask.getTopActivity() : targetTaskTop; targetTaskTop.finishing ? targetTask.getTopNonFinishingActivity() : targetTaskTop; return mMovedToFront ? START_TASK_TO_FRONT : START_DELIVERED_TO_TOP; } Loading Loading @@ -1806,7 +1808,7 @@ class ActivityStarter { * task. */ private void complyActivityFlags(Task targetTask, ActivityRecord reusedActivity) { ActivityRecord targetTaskTop = targetTask.getTopActivity(); ActivityRecord targetTaskTop = targetTask.getTopNonFinishingActivity(); final boolean resetTask = reusedActivity != null && (mLaunchFlags & FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) != 0; if (resetTask) { Loading Loading @@ -2037,7 +2039,8 @@ class ActivityStarter { if (!mOptions.canTaskOverlayResume()) { final Task task = mRootActivityContainer.anyTaskForId( mOptions.getLaunchTaskId()); final ActivityRecord top = task != null ? task.getTopActivity() : null; final ActivityRecord top = task != null ? task.getTopNonFinishingActivity() : null; if (top != null && !top.isState(RESUMED)) { // The caller specifies that we'd like to be avoided to be moved to the Loading Loading @@ -2295,8 +2298,8 @@ class ActivityStarter { if (differentTopTask && !mAvoidMoveToFront) { mStartActivity.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); if (mSourceRecord == null || (mSourceStack.getTopActivity() != null && mSourceStack.getTopActivity().getTask() if (mSourceRecord == null || (mSourceStack.getTopNonFinishingActivity() != null && mSourceStack.getTopNonFinishingActivity().getTask() == mSourceRecord.getTask())) { // We really do want to push this one into the user's face, right now. if (mLaunchTaskBehind && mSourceRecord != null) { Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +7 −7 Original line number Diff line number Diff line Loading @@ -2410,7 +2410,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mStackSupervisor.findTaskToMoveToFront(task, flags, realOptions, "moveTaskToFront", false /* forceNonResizable */); final ActivityRecord topActivity = task.getTopActivity(); final ActivityRecord topActivity = task.getTopNonFinishingActivity(); if (topActivity != null) { // We are reshowing a task, use a starting window to hide the initial draw delay Loading Loading @@ -2999,7 +2999,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { public boolean isTopOfTask(IBinder token) { synchronized (mGlobalLock) { ActivityRecord r = ActivityRecord.isInStackLocked(token); return r != null && r.getTask().getTopActivity() == r; return r != null && r.getTask().getTopNonFinishingActivity() == r; } } Loading Loading @@ -3589,7 +3589,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { "enqueueAssistContext()"); synchronized (mGlobalLock) { ActivityRecord activity = getTopDisplayFocusedStack().getTopActivity(); ActivityRecord activity = getTopDisplayFocusedStack().getTopNonFinishingActivity(); if (activity == null) { Slog.w(TAG, "getAssistContextExtras failed: no top activity"); return null; Loading Loading @@ -3722,7 +3722,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { return false; } final ActivityRecord activity = focusedStack.getTopActivity(); final ActivityRecord activity = focusedStack.getTopNonFinishingActivity(); if (activity == null) { return false; } Loading @@ -3737,7 +3737,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { try { synchronized (mGlobalLock) { ActivityRecord caller = ActivityRecord.forTokenLocked(token); ActivityRecord top = getTopDisplayFocusedStack().getTopActivity(); ActivityRecord top = getTopDisplayFocusedStack().getTopNonFinishingActivity(); if (top != caller) { Slog.w(TAG, "showAssistFromActivity failed: caller " + caller + " is not current top " + top); Loading Loading @@ -4355,7 +4355,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options) { Slog.i(TAG, "Activity tried to startLocalVoiceInteraction"); synchronized (mGlobalLock) { ActivityRecord activity = getTopDisplayFocusedStack().getTopActivity(); ActivityRecord activity = getTopDisplayFocusedStack().getTopNonFinishingActivity(); if (ActivityRecord.forTokenLocked(callingActivity) != activity) { throw new SecurityException("Only focused activity can call startVoiceInteraction"); } Loading Loading @@ -6576,7 +6576,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { + " Requested task not found"); return null; } final ActivityRecord activity = task.getTopActivity(); final ActivityRecord activity = task.getTopNonFinishingActivity(); if (activity == null) { Slog.w(TAG, "getApplicationThreadForTopActivity failed:" + " Requested activity not found"); Loading