summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Bryce Lee <brycelee@google.com> 2017-04-07 10:27:19 -0700
committer Bryce Lee <brycelee@google.com> 2017-04-07 15:11:12 -0700
commit4b51b3232a12cd281eca9662b1085b8f02d7accb (patch)
treeb2fd6517399b52559fc5b1c4d26f9bd60c602500
parentcfeb32287a5882a1c0fcbb26e58953e8b234c899 (diff)
Update decor LayoutParams when window is already added.
These values can change for themes that are dependent on the size, such as the DialogWhenLarge theme. In this case, different layouts are loaded that could depend on updated LayoutParams. This CL identifies the case when the layoutparams change and informs the activity. Change-Id: Icde8d94cc089ca0c02a15120a860533ef540c850 Fixes: 31643268 Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testDialogWhenLargeSplitSmall
-rw-r--r--core/java/android/app/ActivityThread.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 7299d6bd0ed7..182982a638f1 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -3727,9 +3727,17 @@ public final class ActivityThread {
impl.notifyChildRebuilt();
}
}
- if (a.mVisibleFromClient && !a.mWindowAdded) {
- a.mWindowAdded = true;
- wm.addView(decor, l);
+ if (a.mVisibleFromClient) {
+ if (!a.mWindowAdded) {
+ 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
@@ -3769,6 +3777,7 @@ public final class ActivityThread {
wm.updateViewLayout(decor, l);
}
}
+
r.activity.mVisibleFromServer = true;
mNumVisibleActivities++;
if (r.activity.mVisibleFromClient) {