From 119a7f55911ba3e96a35300090bf83d00c5dc4a4 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Wed, 9 Jun 2021 12:32:39 -0700 Subject: [PATCH] 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 --- core/java/android/app/ConfigurationController.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/java/android/app/ConfigurationController.java b/core/java/android/app/ConfigurationController.java index 6d92201db8ec6..f79e0780ecae2 100644 --- a/core/java/android/app/ConfigurationController.java +++ b/core/java/android/app/ConfigurationController.java @@ -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;