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

Commit d9bd79f4 authored by Daniel Chapin's avatar Daniel Chapin Committed by Automerger Merge Worker
Browse files

Merge "Revert "Deferring visibility updates while applying WCT"" into...

Merge "Revert "Deferring visibility updates while applying WCT"" into sc-v2-dev am: 100b9f73 am: f0187aa3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15347902

Change-Id: I894c4523ed8a12784c5b72612f306f213ab24a83
parents bc85a32c f0187aa3
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -352,12 +352,6 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
     */
    private int mVisibilityTransactionDepth;

    /**
     * Whether to the visibility updates that started from {@code RootWindowContainer} should be
     * deferred.
     */
    private boolean mDeferRootVisibilityUpdate;

    private ActivityMetricsLogger mActivityMetricsLogger;

    /** Check if placing task or activity on specified display is allowed. */
@@ -2293,14 +2287,6 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
        return mVisibilityTransactionDepth > 0;
    }

    void setDeferRootVisibilityUpdate(boolean deferUpdate) {
        mDeferRootVisibilityUpdate = deferUpdate;
    }

    boolean isRootVisibilityUpdateDeferred() {
        return mDeferRootVisibilityUpdate;
    }

    /**
     * Called when the state or visibility of an attached activity is changed.
     *
+1 −2
Original line number Diff line number Diff line
@@ -1980,8 +1980,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
     */
    void ensureActivitiesVisible(ActivityRecord starting, int configChanges,
            boolean preserveWindows, boolean notifyClients) {
        if (mTaskSupervisor.inActivityVisibilityUpdate()
                || mTaskSupervisor.isRootVisibilityUpdateDeferred()) {
        if (mTaskSupervisor.inActivityVisibilityUpdate()) {
            // Don't do recursive work.
            return;
        }
+2 −4
Original line number Diff line number Diff line
@@ -4642,11 +4642,9 @@ class Task extends TaskFragment {
            mAtmService.continueWindowLayout();
        }

        if (!mTaskSupervisor.isRootVisibilityUpdateDeferred()) {
        mRootWindowContainer.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS);
        mRootWindowContainer.resumeFocusedTasksTopActivities();
    }
    }

    void resumeNextFocusAfterReparent() {
        adjustFocusToNextFocusableTask("reparent", true /* allowFocusSelf */,
+0 −3
Original line number Diff line number Diff line
@@ -319,7 +319,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
        int effects = 0;
        ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER, "Apply window transaction, syncId=%d", syncId);
        mService.deferWindowLayout();
        mService.mTaskSupervisor.setDeferRootVisibilityUpdate(true /* deferUpdate */);
        try {
            if (transition != null) {
                // First check if we have a display rotation transition and if so, update it.
@@ -408,7 +407,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                task.setMainWindowSizeChangeTransaction(sft);
            }
            if ((effects & TRANSACT_EFFECTS_LIFECYCLE) != 0) {
                mService.mTaskSupervisor.setDeferRootVisibilityUpdate(false /* deferUpdate */);
                // Already calls ensureActivityConfig
                mService.mRootWindowContainer.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS);
                mService.mRootWindowContainer.resumeFocusedTasksTopActivities();
@@ -430,7 +428,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                mService.addWindowLayoutReasons(LAYOUT_REASON_CONFIG_CHANGED);
            }
        } finally {
            mService.mTaskSupervisor.setDeferRootVisibilityUpdate(false /* deferUpdate */);
            mService.continueWindowLayout();
        }
    }