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

Commit f65a303a authored by Tiger Huang's avatar Tiger Huang Committed by Android (Google) Code Review
Browse files

Merge "Don't reset mWindowsInsetsChanged" into main

parents 18403a76 702ef360
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5748,7 +5748,6 @@ public class WindowManagerService extends IWindowManager.Stub
                case INSETS_CHANGED: {
                    synchronized (mGlobalLock) {
                        if (mWindowsInsetsChanged > 0) {
                            mWindowsInsetsChanged = 0;
                            // We need to update resizing windows and dispatch the new insets state
                            // to them.
                            mWindowPlacerLocked.performSurfacePlacement();
@@ -6848,6 +6847,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    pw.println(defaultDisplayContent.getLastOrientation());
            pw.print("  mWaitingForConfig=");
                    pw.println(defaultDisplayContent.mWaitingForConfig);
            pw.print("  mWindowsInsetsChanged="); pw.println(mWindowsInsetsChanged);
            mRotationWatcherController.dump(pw);

            pw.print("  Animation settings: disabled="); pw.print(mAnimationsDisabled);
+14 −11
Original line number Diff line number Diff line
@@ -1443,16 +1443,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                        this, mWindowFrames.getInsetsChangedInfo(),
                        configChanged, didFrameInsetsChange);

            if (insetsChanged) {
                mWindowFrames.setInsetsChanged(false);
                if (mWmService.mWindowsInsetsChanged > 0) {
                    mWmService.mWindowsInsetsChanged--;
                }
                if (mWmService.mWindowsInsetsChanged == 0) {
                    mWmService.mH.removeMessages(WindowManagerService.H.INSETS_CHANGED);
                }
            }

            consumeInsetsChange();
            onResizeHandled();
            mWmService.makeWindowFreezingScreenIfNeededLocked(this);

@@ -2349,6 +2340,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP

        mWmService.mTrustedPresentationListenerController.removeIgnoredWindowTokens(
                getWindowToken());

        consumeInsetsChange();
    }

    @Override
@@ -3722,6 +3715,16 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        return mClient instanceof IWindow.Stub;
    }

    private void consumeInsetsChange() {
        if (mWindowFrames.hasInsetsChanged()) {
            mWindowFrames.setInsetsChanged(false);
            mWmService.mWindowsInsetsChanged--;
            if (mWmService.mWindowsInsetsChanged == 0) {
                mWmService.mH.removeMessages(WindowManagerService.H.INSETS_CHANGED);
            }
        }
    }

    /**
     * Called when the insets state changed.
     */
@@ -3729,10 +3732,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        ProtoLog.d(WM_DEBUG_WINDOW_INSETS, "notifyInsetsChanged for %s ", this);
        if (!mWindowFrames.hasInsetsChanged()) {
            mWindowFrames.setInsetsChanged(true);
            mWmService.mWindowsInsetsChanged++;

            // If the new InsetsState won't be dispatched before releasing WM lock, the following
            // message will be executed.
            mWmService.mWindowsInsetsChanged++;
            mWmService.mH.removeMessages(WindowManagerService.H.INSETS_CHANGED);
            mWmService.mH.sendEmptyMessage(WindowManagerService.H.INSETS_CHANGED);
        }