Refactoring getPreferenceKey method

This method was returnning a constant and getting inlined by proguard.

Change-Id: I87348e25b21483adc1b27d16f99dec4b73205701
This commit is contained in:
Sunny Goyal committed 2015-10-20 09:41:04 -07:00
1 parent 705b4abd57
commit f725824fa2
11 files changed
+33 -65

No files matched your search

@@ -92,8 +92,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
if (packageNames.isEmpty()) {
return;
}
String spKey = LauncherAppState.getSharedPreferencesKey();
SharedPreferences sp = context.getSharedPreferences(spKey, Context.MODE_PRIVATE);
SharedPreferences sp = Utilities.getPrefs(context);
synchronized(sLock) {
Set<String> strings = sp.getStringSet(APPS_PENDING_INSTALL, null);
if (DBG) {
@@ -176,9 +175,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
LauncherAppState app = LauncherAppState.getInstance();
boolean launcherNotLoaded = app.getModel().getCallback() == null;
String spKey = LauncherAppState.getSharedPreferencesKey();
SharedPreferences sp = context.getSharedPreferences(spKey, Context.MODE_PRIVATE);
addToInstallQueue(sp, info);
addToInstallQueue(Utilities.getPrefs(context), info);
if (!mUseInstallQueue && !launcherNotLoaded) {
flushInstallQueue(context);
}
@@ -192,8 +189,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
flushInstallQueue(context);
}
static void flushInstallQueue(Context context) {
String spKey = LauncherAppState.getSharedPreferencesKey();
SharedPreferences sp = context.getSharedPreferences(spKey, Context.MODE_PRIVATE);
SharedPreferences sp = Utilities.getPrefs(context);
ArrayList<PendingInstallShortcutInfo> installQueue = getAndClearInstallQueue(sp, context);
if (!installQueue.isEmpty()) {
Iterator<PendingInstallShortcutInfo> iter = installQueue.iterator();