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

Commit ff0a99fe authored by Tiger Huang's avatar Tiger Huang Committed by Automerger Merge Worker
Browse files

Merge "Only update insetsHint while necessary" into sc-dev am: ea3ff6f8

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

Change-Id: I43de69c76542da2c2a0aa3df4eb03a083ac426d4
parents a89aa479 ea3ff6f8
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ class InsetsSourceProvider {
    private TriConsumer<DisplayFrames, WindowState, Rect> mImeFrameProvider;
    private final Rect mImeOverrideFrame = new Rect();
    private boolean mIsLeashReadyForDispatching;
    private final Rect mLastSourceFrame = new Rect();

    private final Consumer<Transaction> mSetLeashPositionConsumer = t -> {
        if (mControl != null) {
@@ -268,12 +269,15 @@ class InsetsSourceProvider {
                    mSetLeashPositionConsumer.accept(mWin.getPendingTransaction());
                }
            }
            if (mServerVisible && !mLastSourceFrame.equals(mSource.getFrame())) {
                final Insets insetsHint = mSource.calculateInsets(
                        mWin.getBounds(), true /* ignoreVisibility */);
                if (!insetsHint.equals(mControl.getInsetsHint())) {
                    changed = true;
                    mControl.setInsetsHint(insetsHint);
                }
                mLastSourceFrame.set(mSource.getFrame());
            }
            if (changed) {
                mStateController.notifyControlChanged(mControlTarget);
            }