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

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

Reduce unnecessary visibility update after resumed

When starting/resuming activity, ensureVisibilityAndConfig has
already done the update. The invocation in completeResumeLocked
is just duplicated.

Bug: 297502610
Test: CtsWindowManagerDeviceActivity
Change-Id: Ic99513dab200c7a514e516a67468bf38316e6d4a
parent 551d9b71
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -6541,7 +6541,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // Schedule an idle timeout in case the app doesn't do it for us.
        mTaskSupervisor.scheduleIdleTimeout(this);
        mTaskSupervisor.reportResumedActivityLocked(this);
        mTaskSupervisor.mStoppingActivities.remove(this);
        if (getDisplayArea().allResumedActivitiesComplete()) {
            mRootWindowContainer.executeAppTransitionForAllDisplay();
        }
        resumeKeyDispatchingLocked();
        final Task rootTask = getRootTask();
+0 −15
Original line number Diff line number Diff line
@@ -2064,21 +2064,6 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
        }
    }

    boolean reportResumedActivityLocked(ActivityRecord r) {
        // A resumed activity cannot be stopping. remove from list
        mStoppingActivities.remove(r);

        final Task rootTask = r.getRootTask();
        if (rootTask.getDisplayArea().allResumedActivitiesComplete()) {
            mRootWindowContainer.ensureActivitiesVisible();
            // Make sure activity & window visibility should be identical
            // for all displays in this stage.
            mRootWindowContainer.executeAppTransitionForAllDisplay();
            return true;
        }
        return false;
    }

    // Called when WindowManager has finished animating the launchingBehind activity to the back.
    private void handleLaunchTaskBehindCompleteLocked(ActivityRecord r) {
        final Task task = r.getTask();
+2 −0
Original line number Diff line number Diff line
@@ -1894,6 +1894,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
            // Don't do recursive work.
            return;
        }
        Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "RWC_ensureActivitiesVisible");
        mTaskSupervisor.beginActivityVisibilityUpdate();
        try {
            // First the front root tasks. In case any are not fullscreen and are in front of home.
@@ -1903,6 +1904,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
            }
        } finally {
            mTaskSupervisor.endActivityVisibilityUpdate();
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }
    }