summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/InstallShortcutReceiver.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-10-19 16:59:07 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-10-20 09:41:04 -0700
commitf725824fa2091cab44cf1bcbfe5b5b8d06475560 (patch)
tree9a6853686344c9a4581116d814fdc495a68d9924 /src/com/android/launcher3/InstallShortcutReceiver.java
parent705b4abd5793f2b989bca9c53220ffff3014a6ec (diff)
downloadandroid_packages_apps_Trebuchet-f725824fa2091cab44cf1bcbfe5b5b8d06475560.tar.gz
android_packages_apps_Trebuchet-f725824fa2091cab44cf1bcbfe5b5b8d06475560.tar.bz2
android_packages_apps_Trebuchet-f725824fa2091cab44cf1bcbfe5b5b8d06475560.zip
Refactoring getPreferenceKey method
This method was returnning a constant and getting inlined by proguard. Change-Id: I87348e25b21483adc1b27d16f99dec4b73205701
Diffstat (limited to 'src/com/android/launcher3/InstallShortcutReceiver.java')
-rw-r--r--src/com/android/launcher3/InstallShortcutReceiver.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/com/android/launcher3/InstallShortcutReceiver.java b/src/com/android/launcher3/InstallShortcutReceiver.java
index 3fc8fc0a9..9a7519323 100644
--- a/src/com/android/launcher3/InstallShortcutReceiver.java
+++ b/src/com/android/launcher3/InstallShortcutReceiver.java
@@ -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();