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

Commit 84d0442e authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge "Move insets freeze to visibleRequested change" into sc-dev

parents cf280d0e 93b493a2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4383,6 +4383,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            return;
        }
        mVisibleRequested = visible;
        setInsetsFrozen(!visible);
        if (app != null) {
            mTaskSupervisor.onProcessActivityStateChanged(app, false /* forceBatch */);
        }
+0 −7
Original line number Diff line number Diff line
@@ -4101,13 +4101,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
     */
    void onWindowAnimationFinished(@NonNull WindowContainer wc, int type) {
        if (type == ANIMATION_TYPE_APP_TRANSITION || type == ANIMATION_TYPE_RECENTS) {
            // Unfreeze the insets state of the frozen target when the animation finished if exists.
            final Task task = wc.asTask();
            if (task != null) {
                task.forAllWindows(w -> {
                    w.clearFrozenInsetsState();
                }, true /* traverseTopToBottom */);
            }
            removeImeSurfaceImmediately();
        }
    }
+0 −8
Original line number Diff line number Diff line
@@ -2684,14 +2684,6 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
            @Nullable ArrayList<WindowContainer> sources) {
        final Task task = asTask();
        if (task != null && !enter && !task.isHomeOrRecentsRootTask()) {
            if (AppTransition.isClosingTransitOld(transit)) {
                // Freezes the insets state when the window is in app exiting transition, to
                // ensure the exiting window won't receive unexpected insets changes from the
                // next window.
                task.forAllWindows(w -> {
                    w.freezeInsetsState();
                }, true /* traverseTopToBottom */);
            }
            mDisplayContent.showImeScreenshot();
        }
        final Pair<AnimationAdapter, AnimationAdapter> adapters = getAnimationAdapter(lp,
+1 −1
Original line number Diff line number Diff line
@@ -797,7 +797,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     * {@link InsetsStateController#notifyInsetsChanged}.
     */
    boolean isReadyToDispatchInsetsState() {
        return isVisible() && mFrozenInsetsState == null;
        return isVisibleRequested() && mFrozenInsetsState == null;
    }

    void seamlesslyRotateIfAllowed(Transaction transaction, @Rotation int oldRotation,
+9 −0
Original line number Diff line number Diff line
@@ -736,4 +736,13 @@ class WindowToken extends WindowContainer<WindowState> {
    boolean isFromClient() {
        return mFromClientToken;
    }

    /** @see WindowState#freezeInsetsState() */
    void setInsetsFrozen(boolean freeze) {
        if (freeze) {
            forAllWindows(WindowState::freezeInsetsState, true /* traverseTopToBottom */);
        } else {
            forAllWindows(WindowState::clearFrozenInsetsState, true /* traverseTopToBottom */);
        }
    }
}
Loading