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

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

Merge "Skip surface placement if the given insets will not change" into main

parents 933fcb6c 86b8389a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3448,7 +3448,10 @@ public final class ViewRootImpl implements ViewParent,
            // other windows to resize/move based on the raw frame of the window, waiting until we
            // can finish laying out this window and get back to the window manager with the
            // ultimately computed insets.
            insetsPending = computesInternalInsets;
            insetsPending = computesInternalInsets
                    // If this window provides insets via params, its insets source frame can be
                    // updated directly without waiting for WindowSession#setInsets.
                    && mWindowAttributes.providedInsets == null;
            if (mSurfaceHolder != null) {
                mSurfaceHolder.mSurfaceLock.lock();
+1 −1
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ class InsetsSourceProvider {
            return mInsetsHint;
        }
        final WindowState win = mWindowContainer.asWindowState();
        if (win != null && win.mGivenInsetsPending && win.mAttrs.providedInsets == null) {
        if (win != null && win.mGivenInsetsPending) {
            return mInsetsHint;
        }
        if (mInsetsHintStale) {
+8 −0
Original line number Diff line number Diff line
@@ -2109,7 +2109,15 @@ public class WindowManagerService extends IWindowManager.Stub
                        + ", touchableRegion=" + w.mGivenTouchableRegion + " -> " + touchableRegion
                        + ", touchableInsets " + w.mTouchableInsets + " -> " + touchableInsets);
                if (w != null) {
                    final boolean wasGivenInsetsPending = w.mGivenInsetsPending;
                    w.mGivenInsetsPending = false;
                    if ((!wasGivenInsetsPending || !w.hasInsetsSourceProvider())
                            && w.mTouchableInsets == touchableInsets
                            && w.mGivenContentInsets.equals(contentInsets)
                            && w.mGivenVisibleInsets.equals(visibleInsets)
                            && w.mGivenTouchableRegion.equals(touchableRegion)) {
                        return;
                    }
                    w.mGivenContentInsets.set(contentInsets);
                    w.mGivenVisibleInsets.set(visibleInsets);
                    w.mGivenTouchableRegion.set(touchableRegion);
+1 −1
Original line number Diff line number Diff line
@@ -1342,7 +1342,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            // This window doesn't provide any insets.
            return;
        }
        if (mGivenInsetsPending && mAttrs.providedInsets == null) {
        if (mGivenInsetsPending) {
            // The given insets are pending, and they are not reliable for now. The source frame
            // should be updated after the new given insets are sent to window manager.
            return;