diff options
author | Craig Mautner <cmautner@google.com> | 2015-02-19 16:33:09 -0800 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2015-02-19 16:51:26 -0800 |
commit | 72d6f219438e232fcfe0b732d1adb0dbac79dbac (patch) | |
tree | 76394cd1b8f1817f4d3dee1dd7088420cfe7b7d1 | |
parent | b605f4af143bd129ec84bdafe89400cdc022ddc2 (diff) | |
download | frameworks_base-72d6f219438e232fcfe0b732d1adb0dbac79dbac.zip frameworks_base-72d6f219438e232fcfe0b732d1adb0dbac79dbac.tar.gz frameworks_base-72d6f219438e232fcfe0b732d1adb0dbac79dbac.tar.bz2 |
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
-rw-r--r-- | core/java/android/view/ViewRootImpl.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 24fae8a..5b138fe 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -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) { |