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

Commit 26952d74 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Do not call forceLayout if not needed

If the relevant frames for the app don't actually change, there is
no reason to call forceLayout and force a layout pass.

Bug: 27864358
Change-Id: I2add8cc5791023937afc154e6e50bbf7efb35adb
parent d9289085
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -3415,6 +3415,13 @@ public final class ViewRootImpl implements ViewParent,
                        updateConfiguration(config, false);
                    }

                    final boolean framesChanged = !mWinFrame.equals(args.arg1)
                            || !mPendingOverscanInsets.equals(args.arg5)
                            || !mPendingContentInsets.equals(args.arg2)
                            || !mPendingStableInsets.equals(args.arg6)
                            || !mPendingVisibleInsets.equals(args.arg3)
                            || !mPendingOutsets.equals(args.arg7);

                    mWinFrame.set((Rect) args.arg1);
                    mPendingOverscanInsets.set((Rect) args.arg5);
                    mPendingContentInsets.set((Rect) args.arg2);
@@ -3431,7 +3438,7 @@ public final class ViewRootImpl implements ViewParent,
                        mReportNextDraw = true;
                    }

                    if (mView != null) {
                    if (mView != null && framesChanged) {
                        forceLayout(mView);
                    }