diff options
author | Reena Lee <reena@google.com> | 2011-10-24 17:27:37 -0700 |
---|---|---|
committer | Reena Lee <reena@google.com> | 2011-10-24 17:37:11 -0700 |
commit | 99a73f31b7ebed102f393c1bc1909007d7fa8a56 (patch) | |
tree | 7602dc32a74150d81b1f713cc4eb1a4d42b8113e /src | |
parent | f060868dd6ca8fb2f199fefd5cbb19a75ac2c108 (diff) | |
download | android_packages_apps_Trebuchet-99a73f31b7ebed102f393c1bc1909007d7fa8a56.tar.gz android_packages_apps_Trebuchet-99a73f31b7ebed102f393c1bc1909007d7fa8a56.tar.bz2 android_packages_apps_Trebuchet-99a73f31b7ebed102f393c1bc1909007d7fa8a56.zip |
Updated bug fix for Launcher reloading on mcc update.
Store the previousConfig's mcc value only instead of configuration object.
The mPreviousConfig object was a reference to the same object ResourceManager
was using, which can change by the time LauncherModel gets the intent for
ACTION_CONFIGURATION_CHANGED.
This was causing Launcher to not reload all apps as the currentConfig and previousConfig always matched.
Bug 5040470
Change-Id: Ie7102cc233177e05cb0e0e2ae4240309c16ebf66
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/LauncherModel.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 3ee273214..c06bc0c31 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -121,7 +121,7 @@ public class LauncherModel extends BroadcastReceiver { private static int mCellCountX; private static int mCellCountY; - protected Configuration mPreviousConfig; + protected int mPreviousConfigMcc; public interface Callbacks { public boolean setLoadOnResume(); @@ -152,7 +152,8 @@ public class LauncherModel extends BroadcastReceiver { final Resources res = app.getResources(); mAllAppsLoadDelay = res.getInteger(R.integer.config_allAppsBatchLoadDelay); mBatchSize = res.getInteger(R.integer.config_allAppsBatchSize); - mPreviousConfig = res.getConfiguration(); + Configuration config = res.getConfiguration(); + mPreviousConfigMcc = config.mcc; } public Bitmap getFallbackIcon() { @@ -623,13 +624,13 @@ public class LauncherModel extends BroadcastReceiver { // and we would need to clear out the labels in all apps/workspace. Same handling as // above for ACTION_LOCALE_CHANGED Configuration currentConfig = context.getResources().getConfiguration(); - if((mPreviousConfig.diff(currentConfig) & ActivityInfo.CONFIG_MCC) != 0){ + if (mPreviousConfigMcc != currentConfig.mcc) { Log.d(TAG, "Reload apps on config change. curr_mcc:" - + currentConfig.mcc + " prevmcc:" + mPreviousConfig.mcc); + + currentConfig.mcc + " prevmcc:" + mPreviousConfigMcc); forceReload(); } // Update previousConfig - mPreviousConfig = currentConfig; + mPreviousConfigMcc = currentConfig.mcc; } else if (SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED.equals(action) || SearchManager.INTENT_ACTION_SEARCHABLES_CHANGED.equals(action)) { if (mCallbacks != null) { |