diff options
| author | Dianne Hackborn <hackbod@google.com> | 2011-06-03 13:17:00 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2011-06-03 13:17:00 -0700 |
| commit | 50469db07167e3a837e10f215baa4eacb1319604 (patch) | |
| tree | c05a65fb42218589897b459cfcbac5b0fe411f49 /core/java/android/app/ActivityThread.java | |
| parent | 8c56154d9aa9573280d144cd361f9ef3f2435651 (diff) | |
| parent | 7322e557cfe42da42779625d69ced2db74a9df90 (diff) | |
am 7322e557: am a4cfcf10: am 75d6b3c2: Merge "Fix issue #4502672: Wrong xml resources used for homescreen widgets." into honeycomb-mr2
* commit '7322e557cfe42da42779625d69ced2db74a9df90':
Fix issue #4502672: Wrong xml resources used for homescreen widgets.
Diffstat (limited to 'core/java/android/app/ActivityThread.java')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 7e20c756cafb..51c7a0a919fa 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -172,6 +172,11 @@ public final class ActivityThread { // These can be accessed by multiple threads; mPackages is the lock. // XXX For now we keep around information about all packages we have // seen, not removing entries from this map. + // NOTE: The activity manager in its process needs to call in to + // ActivityThread to do things like update resource configurations, + // which means this lock gets held while the activity manager holds its + // own lock. Thus you MUST NEVER call back into the activity manager + // or anything that depends on it while holding this lock. final HashMap<String, WeakReference<LoadedApk>> mPackages = new HashMap<String, WeakReference<LoadedApk>>(); final HashMap<String, WeakReference<LoadedApk>> mResourcePackages @@ -1489,7 +1494,7 @@ public final class ActivityThread { } public Configuration getConfiguration() { - return mConfiguration; + return mResConfiguration; } public boolean isProfiling() { @@ -1534,7 +1539,7 @@ public final class ActivityThread { synchronized (this) { ContextImpl context = getSystemContext(); context.init(new LoadedApk(this, "android", context, info, - new CompatibilityInfo(info, 0, 0, false)), null, this); + CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO), null, this); } } @@ -3293,6 +3298,12 @@ public final class ActivityThread { } } + public final void applyConfigurationToResources(Configuration config) { + synchronized (mPackages) { + applyConfigurationToResourcesLocked(config, null); + } + } + final boolean applyConfigurationToResourcesLocked(Configuration config, CompatibilityInfo compat) { if (mResConfiguration == null) { @@ -3518,8 +3529,7 @@ public final class ActivityThread { * reflect configuration changes. The configuration object passed * in AppBindData can be safely assumed to be up to date */ - Resources.getSystem().updateConfiguration(mConfiguration, - Resources.getSystem().getDisplayMetrics(), data.compatInfo); + applyConfigurationToResourcesLocked(data.config, data.compatInfo); data.info = getPackageInfoNoCheck(data.appInfo, data.compatInfo); |
