Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19743818 authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "Fix black frame when unlocking device via clicking on notification" into nyc-dev

parents de2fa62f dea4bd98
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);
            }

+23 −11
Original line number Diff line number Diff line
@@ -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
+6 −7
Original line number Diff line number Diff line
@@ -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;
@@ -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