Fix RRO handleConfigurationChanged race condition

Retrieval of the system and system UI themes should be done with the
ResourcesManager lock held to ensure the theme retrieved has the new
overlays applied.

Bug: 189100984
Test: manual
Change-Id: Ibe27ec745ea5a914d3d05e393598a336d96a55e6
This commit is contained in:
Ryan Mitchell
2021-06-09 12:32:39 -07:00
parent 72cd5f1552
commit 119a7f5591

View File

@@ -158,10 +158,9 @@ class ConfigurationController {
int configDiff;
boolean equivalent;
final Resources.Theme systemTheme = mActivityThread.getSystemContext().getTheme();
final Resources.Theme systemUiTheme = mActivityThread.getSystemUiContext().getTheme();
synchronized (mResourcesManager) {
final Resources.Theme systemTheme = mActivityThread.getSystemContext().getTheme();
final Resources.Theme systemUiTheme = mActivityThread.getSystemUiContext().getTheme();
if (mPendingConfiguration != null) {
if (!mPendingConfiguration.isOtherSeqNewer(config)) {
config = mPendingConfiguration;