Permit layout when stopped if reporting draw
When a device was woken up in a different orientation than what it went to sleep in, the window manager would force a resize to get it to predraw in the new orientation. The predraw was done in the old orientation however because layouts are skipped when the activity was stopped. This change allows layouts to proceed when the activity is stopped if the flag to report resize events is true. Fixes bug 18444400. Change-Id: Ib2def3449dd67918f6fb838bdb1fe5cc6ec57f8e
This commit is contained in:
@@ -1342,7 +1342,7 @@ public final class ViewRootImpl implements ViewParent,
|
||||
|
||||
boolean insetsChanged = false;
|
||||
|
||||
boolean layoutRequested = mLayoutRequested && !mStopped;
|
||||
boolean layoutRequested = mLayoutRequested && (!mStopped || mReportNextDraw);
|
||||
if (layoutRequested) {
|
||||
|
||||
final Resources res = mView.getContext().getResources();
|
||||
@@ -1774,7 +1774,7 @@ public final class ViewRootImpl implements ViewParent,
|
||||
}
|
||||
}
|
||||
|
||||
if (!mStopped) {
|
||||
if (!mStopped || mReportNextDraw) {
|
||||
boolean focusChangedDueToTouchMode = ensureTouchModeLocally(
|
||||
(relayoutResult&WindowManagerGlobal.RELAYOUT_RES_IN_TOUCH_MODE) != 0);
|
||||
if (focusChangedDueToTouchMode || mWidth != host.getMeasuredWidth()
|
||||
@@ -1847,7 +1847,7 @@ public final class ViewRootImpl implements ViewParent,
|
||||
}
|
||||
}
|
||||
|
||||
final boolean didLayout = layoutRequested && !mStopped;
|
||||
final boolean didLayout = layoutRequested && (!mStopped || mReportNextDraw);
|
||||
boolean triggerGlobalLayoutListener = didLayout
|
||||
|| mAttachInfo.mRecomputeGlobalAttributes;
|
||||
if (didLayout) {
|
||||
|
||||
Reference in New Issue
Block a user