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

Commit f898c779 authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Reset mCurrentLaunchCanTurnScreenOn state after transition finishes" into main

parents 5610bd19 60e7de86
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -1365,18 +1365,6 @@ class ActivityStarter {
            request.outActivity[0] = mLastStartActivityRecord;
        }

        // Reset the ActivityRecord#mCurrentLaunchCanTurnScreenOn state of activity started
        // before this one if it is no longer the top-most focusable activity.
        // Doing so in case the state is not yet consumed during rapid activity launch.
        if (previousStart != null && !previousStart.finishing && previousStart.isAttached()
                && previousStart.currentLaunchCanTurnScreenOn()) {
            final ActivityRecord topFocusable = previousStart.getDisplayContent().getActivity(
                    ar -> ar.isFocusable() && !ar.finishing);
            if (previousStart != topFocusable) {
                previousStart.setCurrentLaunchCanTurnScreenOn(false);
            }
        }

        return mLastStartActivityResult;
    }

+11 −2
Original line number Diff line number Diff line
@@ -1374,13 +1374,22 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        // processed all the participants first (in particular, we want to trigger pip-enter first)
        for (int i = 0; i < mParticipants.size(); ++i) {
            final ActivityRecord ar = mParticipants.valueAt(i).asActivityRecord();
            if (ar == null) continue;

            // If the activity was just inserted to an invisible task, it will keep INITIALIZING
            // state. Then no need to notify the callback to avoid clearing some states
            // unexpectedly, e.g. launch-task-behind.
            if (ar != null && (ar.isVisibleRequested()
                    || !ar.isState(ActivityRecord.State.INITIALIZING))) {
            if (ar.isVisibleRequested() || !ar.isState(ActivityRecord.State.INITIALIZING)) {
                mController.dispatchLegacyAppTransitionFinished(ar);
            }

            // Reset the ActivityRecord#mCurrentLaunchCanTurnScreenOn state if it is not the top
            // running activity. Doing so in case the state is not yet consumed during rapid
            // activity launch.
            if (ar.currentLaunchCanTurnScreenOn() && ar.getDisplayContent() != null
                    && ar.getDisplayContent().topRunningActivity() != ar) {
                ar.setCurrentLaunchCanTurnScreenOn(false);
            }
        }

        // Update the input-sink (touch-blocking) state now that the animation is finished.