Loading services/core/java/com/android/server/am/ActivityStack.java +3 −2 Original line number Diff line number Diff line Loading @@ -2213,10 +2213,11 @@ final class ActivityStack { ActivityStack lastStack = mStackSupervisor.getLastStack(); if (next.app != null && next.app.thread != null) { if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "Resume running: " + next); if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "Resume running: " + next + " stopped=" + next.stopped + " visible=" + next.visible); // This activity is now becoming visible. if (!next.visible) { if (!next.visible || next.stopped) { mWindowManager.setAppVisibility(next.appToken, true); } Loading services/core/java/com/android/server/am/ActivityStarter.java +23 −11 Original line number Diff line number Diff line Loading @@ -1327,20 +1327,32 @@ class ActivityStarter { intentActivity.setTaskToAffiliateWith(mSourceRecord.task); } mMovedHome = true; final ActivityStack launchStack = getLaunchStack(mStartActivity, mLaunchFlags, mStartActivity.task, mOptions, true); // If the launch flags carry both NEW_TASK and CLEAR_TASK, the task's activities // will be cleared soon by ActivityStarter in setTaskFromIntentActivity(). // So no point resuming any of the activities here, it just wastes one extra // resuming, plus enter AND exit transitions. // Here we only want to bring the target stack forward. Transition will be applied // to the new activity that's started after the old ones are gone. final boolean willClearTask = (mLaunchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK)) == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK); if (!willClearTask) { final ActivityStack launchStack = getLaunchStack( mStartActivity, mLaunchFlags, mStartActivity.task, mOptions, true); if (launchStack == null || launchStack == mTargetStack) { // 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 // task on top there. mTargetStack.moveTaskToFrontLocked(intentActivity.task, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "bringingFoundTaskToFront"); mTargetStack.moveTaskToFrontLocked( intentActivity.task, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "bringingFoundTaskToFront"); mMovedToFront = true; } updateTaskReturnToType(intentActivity.task, mLaunchFlags, focusStack); mOptions = null; } updateTaskReturnToType(intentActivity.task, mLaunchFlags, focusStack); } } if (!mMovedToFront && mDoResume) { if (DEBUG_TASKS) Slog.d(TAG_TASKS, "Bring to front target: " + mTargetStack Loading services/core/java/com/android/server/wm/WindowManagerService.java +6 −7 Original line number Diff line number Diff line Loading @@ -4255,16 +4255,12 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.appDied = false; wtoken.removeAllWindows(); } else if (visible) { if (DEBUG_ADD_REMOVE) Slog.v( TAG_WM, "No longer Stopped: " + wtoken); wtoken.mAppStopped = false; mOpeningApps.add(wtoken); wtoken.startingMoved = false; // If the token is currently hidden (should be the // common case), then we need to set up to wait for // its windows to be ready. if (wtoken.hidden) { // If the token is currently hidden (should be the common case), or has been // stopped, then we need to set up to wait for its windows to be ready. if (wtoken.hidden || wtoken.mAppStopped) { wtoken.allDrawn = false; wtoken.deferClearAllDrawn = false; wtoken.waitingToShow = true; Loading @@ -4280,6 +4276,9 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.sendAppVisibilityToClients(); } } if (DEBUG_ADD_REMOVE) Slog.v( TAG_WM, "No longer Stopped: " + wtoken); wtoken.mAppStopped = false; } // If we are preparing an app transition, then delay changing Loading Loading
services/core/java/com/android/server/am/ActivityStack.java +3 −2 Original line number Diff line number Diff line Loading @@ -2213,10 +2213,11 @@ final class ActivityStack { ActivityStack lastStack = mStackSupervisor.getLastStack(); if (next.app != null && next.app.thread != null) { if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "Resume running: " + next); if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "Resume running: " + next + " stopped=" + next.stopped + " visible=" + next.visible); // This activity is now becoming visible. if (!next.visible) { if (!next.visible || next.stopped) { mWindowManager.setAppVisibility(next.appToken, true); } Loading
services/core/java/com/android/server/am/ActivityStarter.java +23 −11 Original line number Diff line number Diff line Loading @@ -1327,20 +1327,32 @@ class ActivityStarter { intentActivity.setTaskToAffiliateWith(mSourceRecord.task); } mMovedHome = true; final ActivityStack launchStack = getLaunchStack(mStartActivity, mLaunchFlags, mStartActivity.task, mOptions, true); // If the launch flags carry both NEW_TASK and CLEAR_TASK, the task's activities // will be cleared soon by ActivityStarter in setTaskFromIntentActivity(). // So no point resuming any of the activities here, it just wastes one extra // resuming, plus enter AND exit transitions. // Here we only want to bring the target stack forward. Transition will be applied // to the new activity that's started after the old ones are gone. final boolean willClearTask = (mLaunchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK)) == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK); if (!willClearTask) { final ActivityStack launchStack = getLaunchStack( mStartActivity, mLaunchFlags, mStartActivity.task, mOptions, true); if (launchStack == null || launchStack == mTargetStack) { // 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 // task on top there. mTargetStack.moveTaskToFrontLocked(intentActivity.task, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "bringingFoundTaskToFront"); mTargetStack.moveTaskToFrontLocked( intentActivity.task, mNoAnimation, mOptions, mStartActivity.appTimeTracker, "bringingFoundTaskToFront"); mMovedToFront = true; } updateTaskReturnToType(intentActivity.task, mLaunchFlags, focusStack); mOptions = null; } updateTaskReturnToType(intentActivity.task, mLaunchFlags, focusStack); } } if (!mMovedToFront && mDoResume) { if (DEBUG_TASKS) Slog.d(TAG_TASKS, "Bring to front target: " + mTargetStack Loading
services/core/java/com/android/server/wm/WindowManagerService.java +6 −7 Original line number Diff line number Diff line Loading @@ -4255,16 +4255,12 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.appDied = false; wtoken.removeAllWindows(); } else if (visible) { if (DEBUG_ADD_REMOVE) Slog.v( TAG_WM, "No longer Stopped: " + wtoken); wtoken.mAppStopped = false; mOpeningApps.add(wtoken); wtoken.startingMoved = false; // If the token is currently hidden (should be the // common case), then we need to set up to wait for // its windows to be ready. if (wtoken.hidden) { // If the token is currently hidden (should be the common case), or has been // stopped, then we need to set up to wait for its windows to be ready. if (wtoken.hidden || wtoken.mAppStopped) { wtoken.allDrawn = false; wtoken.deferClearAllDrawn = false; wtoken.waitingToShow = true; Loading @@ -4280,6 +4276,9 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.sendAppVisibilityToClients(); } } if (DEBUG_ADD_REMOVE) Slog.v( TAG_WM, "No longer Stopped: " + wtoken); wtoken.mAppStopped = false; } // If we are preparing an app transition, then delay changing Loading