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

Commit 1d4f17a0 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Revert "Reduce unnecessary visibility update after resumed"" into main

parents 5d2791d7 cc946a4d
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -6562,10 +6562,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // Schedule an idle timeout in case the app doesn't do it for us.
        // Schedule an idle timeout in case the app doesn't do it for us.
        mTaskSupervisor.scheduleIdleTimeout(this);
        mTaskSupervisor.scheduleIdleTimeout(this);
        mTaskSupervisor.mStoppingActivities.remove(this);
        mTaskSupervisor.reportResumedActivityLocked(this);
        if (getDisplayArea().allResumedActivitiesComplete()) {
            mRootWindowContainer.executeAppTransitionForAllDisplay();
        }
        resumeKeyDispatchingLocked();
        resumeKeyDispatchingLocked();
        final Task rootTask = getRootTask();
        final Task rootTask = getRootTask();
+15 −0
Original line number Original line Diff line number Diff line
@@ -2064,6 +2064,21 @@ 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.
    // Called when WindowManager has finished animating the launchingBehind activity to the back.
    private void handleLaunchTaskBehindCompleteLocked(ActivityRecord r) {
    private void handleLaunchTaskBehindCompleteLocked(ActivityRecord r) {
        final Task task = r.getTask();
        final Task task = r.getTask();
+0 −2
Original line number Original line Diff line number Diff line
@@ -1905,7 +1905,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
            // Don't do recursive work.
            // Don't do recursive work.
            return;
            return;
        }
        }
        Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "RWC_ensureActivitiesVisible");
        mTaskSupervisor.beginActivityVisibilityUpdate();
        mTaskSupervisor.beginActivityVisibilityUpdate();
        try {
        try {
            // First the front root tasks. In case any are not fullscreen and are in front of home.
            // First the front root tasks. In case any are not fullscreen and are in front of home.
@@ -1915,7 +1914,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
            }
            }
        } finally {
        } finally {
            mTaskSupervisor.endActivityVisibilityUpdate();
            mTaskSupervisor.endActivityVisibilityUpdate();
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }
        }
    }
    }