summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-04-09 15:45:30 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-09 15:45:30 -0700
commit7652bef7d3cbadacb57ae3460489f5cb7930d681 (patch)
tree80fc98862b1a9b55ba2a91dd1d2051e93d68bde8 /src/com/android
parentc6cc61d45836e4081920883cc4d448ccb0bb8417 (diff)
parent3cbb169bcf193193786818ee3c61defdc95cfd92 (diff)
downloadandroid_packages_apps_Trebuchet-7652bef7d3cbadacb57ae3460489f5cb7930d681.tar.gz
android_packages_apps_Trebuchet-7652bef7d3cbadacb57ae3460489f5cb7930d681.tar.bz2
android_packages_apps_Trebuchet-7652bef7d3cbadacb57ae3460489f5cb7930d681.zip
Merge "Fixing strict mode warning when installing an app in the bg."
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher2/InstallShortcutReceiver.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/launcher2/InstallShortcutReceiver.java b/src/com/android/launcher2/InstallShortcutReceiver.java
index 4c0974fd3..651bdaff2 100644
--- a/src/com/android/launcher2/InstallShortcutReceiver.java
+++ b/src/com/android/launcher2/InstallShortcutReceiver.java
@@ -102,8 +102,8 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
}
private boolean installShortcut(Context context, Intent data, ArrayList<ItemInfo> items,
- String name, Intent intent, int screen, boolean shortcutExists,
- SharedPreferences sharedPrefs, int[] result) {
+ String name, Intent intent, final int screen, boolean shortcutExists,
+ final SharedPreferences sharedPrefs, int[] result) {
if (findEmptyCell(context, items, mCoordinates, screen)) {
if (intent != null) {
if (intent.getAction() == null) {
@@ -122,10 +122,15 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
newApps = sharedPrefs.getStringSet(NEW_APPS_LIST_KEY, newApps);
}
newApps.add(intent.toUri(0).toString());
- sharedPrefs.edit()
- .putInt(NEW_APPS_PAGE_KEY, screen)
- .putStringSet(NEW_APPS_LIST_KEY, newApps)
- .commit();
+ final Set<String> savedNewApps = newApps;
+ new Thread("setNewAppsThread") {
+ public void run() {
+ sharedPrefs.edit()
+ .putInt(NEW_APPS_PAGE_KEY, screen)
+ .putStringSet(NEW_APPS_LIST_KEY, savedNewApps)
+ .commit();
+ }
+ }.start();
// Update the Launcher db
LauncherApplication app = (LauncherApplication) context.getApplicationContext();