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
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
wm.updateViewLayout(decor, l);
}
}
+
r.activity.mVisibleFromServer = true;
mNumVisibleActivities++;
if (r.activity.mVisibleFromClient) {