Cherry-pick system theme rebase to fix square UI on round watches

Our system themes were based on configurations that were added post-
init of the system theme.

I96e695441543379e4d5fdf3cc6f18d9e6cf953b4 broke this, because there
was a race condition in the code for rebasing themes

If8fecde76d62738a8e55eddf898eafc468afdba2 (the cherry-picked commit)
fixes the race condition and adds the rebasing back in.

This change cherry picks If8fecde76d62738a8e55eddf898eafc468afdba2.

Bug:23387146
Change-Id: I0725028e48599fc6cd9731ae16c71474dd5827e5
This commit is contained in:
Alan Viverette
2015-08-11 17:27:04 -04:00
committed by Alex Hills
parent 5a45dc960b
commit 3d2337eeb5
3 changed files with 96 additions and 122 deletions

View File

@@ -1047,6 +1047,12 @@ public final class SystemServer {
w.getDefaultDisplay().getMetrics(metrics);
context.getResources().updateConfiguration(config, metrics);
// The system context's theme may be configuration-dependent.
final Theme systemTheme = context.getTheme();
if (systemTheme.getChangingConfigurations() != 0) {
systemTheme.rebase();
}
try {
// TODO: use boot phase
mPowerManagerService.systemReady(mActivityManagerService.getAppOpsService());