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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user