summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Fischer <enf@google.com>2009-10-29 01:47:34 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-10-29 01:47:34 -0700
commit25510e077766cf023dd0adb9c84d6d5f82cc01bc (patch)
tree27fb5351405ea34132131d442b3d639b192d9110 /services
parent5fc26f609aaf0a878bd821e9d8df96be025fe2f8 (diff)
parent8071b14680f8081019ac1b995d7c7f09a8aeeba7 (diff)
downloadframeworks_base-25510e077766cf023dd0adb9c84d6d5f82cc01bc.zip
frameworks_base-25510e077766cf023dd0adb9c84d6d5f82cc01bc.tar.gz
frameworks_base-25510e077766cf023dd0adb9c84d6d5f82cc01bc.tar.bz2
am 8071b146: am fb872d1a: Merge change Id4d04def into eclair
Merge commit '8071b14680f8081019ac1b995d7c7f09a8aeeba7' into eclair-mr2-plus-aosp * commit '8071b14680f8081019ac1b995d7c7f09a8aeeba7': Fix a race that kept the locale picker from working under heavy CPU load.
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java32
1 files changed, 25 insertions, 7 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 088d5e5..bfbe01e 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -2705,13 +2705,31 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
// Have the window manager re-evaluate the orientation of
// the screen based on the new activity order.
- Configuration config = mWindowManager.updateOrientationFromAppTokens(
- mConfiguration,
- next.mayFreezeScreenLocked(next.app) ? next : null);
- if (config != null) {
- next.frozenBeforeDestroy = true;
- }
- if (!updateConfigurationLocked(config, next)) {
+ boolean updated;
+ synchronized (this) {
+ Configuration config = mWindowManager.updateOrientationFromAppTokens(
+ mConfiguration,
+ next.mayFreezeScreenLocked(next.app) ? next : null);
+ if (config != null) {
+ /*
+ * Explicitly restore the locale to the one from the
+ * old configuration, since the one that comes back from
+ * the window manager has the default (boot) locale.
+ *
+ * It looks like previously the locale picker only worked
+ * by coincidence: usually it would do its setting of
+ * the locale after the activity transition, so it didn't
+ * matter that this lost it. With the synchronized
+ * block now keeping them from happening at the same time,
+ * this one always would happen second and undo what the
+ * locale picker had just done.
+ */
+ config.locale = mConfiguration.locale;
+ next.frozenBeforeDestroy = true;
+ }
+ updated = updateConfigurationLocked(config, next);
+ }
+ if (!updated) {
// The configuration update wasn't able to keep the existing
// instance of the activity, and instead started a new one.
// We should be all done, but let's just make sure our activity