Removing extraneous apps-customize page reset. (Bug 11027505)
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 5aec399..85de80a 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -838,7 +838,7 @@
         if (mOnResumeState == State.WORKSPACE) {
             showWorkspace(false);
         } else if (mOnResumeState == State.APPS_CUSTOMIZE) {
-            showAllApps(false, AppsCustomizePagedView.ContentType.Applications);
+            showAllApps(false, AppsCustomizePagedView.ContentType.Applications, false);
         }
         mOnResumeState = State.NONE;
 
@@ -893,10 +893,7 @@
             // 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
@@ -1161,7 +1158,7 @@
         widgetButton.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View arg0) {
-                showAllApps(true, AppsCustomizePagedView.ContentType.Widgets);
+                showAllApps(true, AppsCustomizePagedView.ContentType.Widgets, true);
             }
         });
         widgetButton.setOnTouchListener(getHapticFeedbackTouchListener());
@@ -2174,7 +2171,7 @@
                 final String shortcutClass = intent.getComponent().getClassName();
 
                 if (shortcutClass.equals(WidgetAdder.class.getName())) {
-                    showAllApps(true, AppsCustomizePagedView.ContentType.Widgets);
+                    showAllApps(true, AppsCustomizePagedView.ContentType.Widgets, true);
                     return;
                 } else if (shortcutClass.equals(MemoryDumpActivity.class.getName())) {
                     MemoryDumpActivity.startDump(this);
@@ -2264,7 +2261,7 @@
      * @param v The view that was clicked.
      */
     public void onClickAllAppsButton(View v) {
-        showAllApps(true, AppsCustomizePagedView.ContentType.Applications);
+        showAllApps(true, AppsCustomizePagedView.ContentType.Applications, true);
     }
 
     public void onTouchDownAllAppsButton(View v) {
@@ -3075,10 +3072,13 @@
     public void onWorkspaceShown(boolean animated) {
     }
 
-    void showAllApps(boolean animated,
-                     AppsCustomizePagedView.ContentType contentType) {
+    void showAllApps(boolean animated, AppsCustomizePagedView.ContentType contentType,
+                     boolean resetPageToZero) {
         if (mState != State.WORKSPACE) return;
 
+        if (resetPageToZero) {
+            mAppsCustomizeTabHost.reset();
+        }
         showAppsCustomizeHelper(animated, false, contentType);
         mAppsCustomizeTabHost.requestFocus();