Fixing strict mode warning when installing an app in the bg.

Change-Id: I3cb13f4302245f055ef0b16823690c80b4d3ee3a
diff --git a/src/com/android/launcher2/InstallShortcutReceiver.java b/src/com/android/launcher2/InstallShortcutReceiver.java
index 4c0974f..651bdaf 100644
--- a/src/com/android/launcher2/InstallShortcutReceiver.java
+++ b/src/com/android/launcher2/InstallShortcutReceiver.java
@@ -102,8 +102,8 @@
     }
 
     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 @@
                         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();