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

Commit 10949759 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Indicate potential incomplete transition

To catch the case such as when an activity is still pausing, and
a caller sets transition to ready too early. And then when resuming
next activity in the same task, its visibility will be updated
without an associated transition.

Previously, the visibility will be skipped because the activity
is a child of the task in transition participant but itself is
not in participants.

Bug: 269732484
Test: TransitionTests
Change-Id: I9a184b97974f337fb123e11853bea50ace9bf843
parent 7137d916
Loading
Loading
Loading
Loading
+17 −8
Original line number Diff line number Diff line
@@ -5225,7 +5225,16 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                Debug.getCallers(6));

        // Before setting mVisibleRequested so we can track changes.
        boolean isCollecting = false;
        if (mTransitionController.isShellTransitionsEnabled()) {
            isCollecting = mTransitionController.isCollecting();
            if (isCollecting) {
                mTransitionController.collect(this);
            } else {
                Slog.e(TAG, "setVisibility=" + visible + " while transition is not collecting "
                        + this + " caller=" + Debug.getCallers(8));
            }
        }

        onChildVisibilityRequested(visible);

@@ -5297,9 +5306,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }

        // Defer committing visibility until transition starts.
        if (inTransition()) {
            if (!visible && mTransitionController.inPlayingTransition(this)
                    && mTransitionController.isCollecting(this)) {
        if (isCollecting) {
            // It may be occluded by the activity above that calls convertFromTranslucent().
            if (!visible && mTransitionController.inPlayingTransition(this)) {
                mTransitionChangeFlags |= FLAG_IS_OCCLUDED;
            }
            return;
@@ -5319,11 +5328,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     * Then its visibility will be committed until the transition is ready.
     */
    private boolean deferCommitVisibilityChange(boolean visible) {
        if (!mDisplayContent.mAppTransition.isTransitionSet()) {
        if (mTransitionController.isShellTransitionsEnabled()) {
            // Shell transition doesn't use opening/closing sets.
            return false;
        }
        if (!mDisplayContent.mAppTransition.isTransitionSet()) {
            // Defer committing visibility for non-home app which is animating by recents.
            if (isActivityTypeHome() || !isAnimating(PARENTS, ANIMATION_TYPE_RECENTS)) {
                return false;