Integrating some aosp fixes, ensuring that we update the install queue before returning to Launcher.

- Fixing stuck page in All Apps (Bug 9347818)
- Fixing shortcuts to uninstalled apps from being installed (Bug 10726510)
- Consolidating vibration feedback
- Ensuring that we trim names during comparison in AllApps list

Change-Id: Ieaae4d85851ce771283b4684a8a60306da28cb3b
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 5bb4f75..149a523 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -834,9 +834,6 @@
         // Background was set to gradient in onPause(), restore to black if in all apps.
         setWorkspaceBackground(mState == State.WORKSPACE);
 
-        // Process any items that were added while Launcher was away
-        InstallShortcutReceiver.disableAndFlushInstallQueue(this);
-
         mPaused = false;
         sPausedFromUserAction = false;
         if (mRestoring || mOnResumeNeedsLoad) {
@@ -885,12 +882,19 @@
             // Resets the previous all apps icon press state
             mAppsCustomizeContent.resetDrawableState();
         }
+        // Reset AllApps to its initial state
+        if (mAppsCustomizeTabHost != null) {
+            mAppsCustomizeTabHost.reset();
+        }
         // It is possible that widgets can receive updates while launcher is not in the foreground.
         // Consequently, the widgets will be inflated in the orientation of the foreground activity
         // (framework issue). On resuming, we ensure that any widgets are inflated for the current
         // orientation.
         getWorkspace().reinflateWidgetsIfNecessary();
 
+        // Process any items that were added while Launcher was away.
+        InstallShortcutReceiver.disableAndFlushInstallQueue(this);
+
         // Again, as with the above scenario, it's possible that one or more of the global icons
         // were updated in the wrong orientation.
         updateGlobalIcons();