Merge "Update decor LayoutParams when window is already added." into oc-dev

am: 9c80a16c45

Change-Id: I176bf43e9a200fc31641abe2fe45f2e0a284005f
This commit is contained in:
Bryce Lee
2017-04-10 14:30:08 +00:00
committed by android-build-merger

View File

@@ -3727,9 +3727,17 @@ public final class ActivityThread {
impl.notifyChildRebuilt(); impl.notifyChildRebuilt();
} }
} }
if (a.mVisibleFromClient && !a.mWindowAdded) { if (a.mVisibleFromClient) {
a.mWindowAdded = true; if (!a.mWindowAdded) {
wm.addView(decor, l); a.mWindowAdded = true;
wm.addView(decor, l);
} else {
// The activity will get a callback for this {@link LayoutParams} change
// earlier. However, at that time the decor will not be set (this is set
// in this method), so no action will be taken. This call ensures the
// callback occurs with the decor set.
a.onWindowAttributesChanged(l);
}
} }
// If the window has already been added, but during resume // If the window has already been added, but during resume
@@ -3769,6 +3777,7 @@ public final class ActivityThread {
wm.updateViewLayout(decor, l); wm.updateViewLayout(decor, l);
} }
} }
r.activity.mVisibleFromServer = true; r.activity.mVisibleFromServer = true;
mNumVisibleActivities++; mNumVisibleActivities++;
if (r.activity.mVisibleFromClient) { if (r.activity.mVisibleFromClient) {