Paper over bug 2592956 - Home not redrawing the shortcuts, widgets, or background.

The mNext* stuff in AllApps3D got reset when onNewIntent came in too fast after an
onCreate, which happened because of the configuration changed.

Change-Id: I9a358b6969ac1d17ea98f58218d47bfe983936f0
diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java
index 64c8c4c..9d3de0b 100644
--- a/src/com/android/launcher2/AllApps3D.java
+++ b/src/com/android/launcher2/AllApps3D.java
@@ -91,6 +91,10 @@
     private static RenderScriptGL sRS;
     private static RolloRS sRollo;
 
+    private static boolean sZoomDirty = false;
+    private static boolean sAnimateNextZoom;
+    private static float sNextZoom;
+
     /**
      * True when we are using arrow keys or trackball to drive navigation
      */
@@ -120,9 +124,6 @@
     private boolean mShouldGainFocus;
 
     private boolean mHaveSurface = false;
-    private boolean mZoomDirty = false;
-    private boolean mAnimateNextZoom;
-    private float mNextZoom;
     private float mZoom;
     private float mVelocity;
     private AAMessage mMessageProc;
@@ -241,7 +242,7 @@
         }
         // We may lose any callbacks that are pending, so make sure that we re-sync that
         // on the next surfaceChanged.
-        mZoomDirty = true;
+        sZoomDirty = true;
         mHaveSurface = false;
     }
 
@@ -801,12 +802,12 @@
      */
     public void zoom(float zoom, boolean animate) {
         cancelLongPress();
-        mNextZoom = zoom;
-        mAnimateNextZoom = animate;
+        sNextZoom = zoom;
+        sAnimateNextZoom = animate;
         // if we do setZoom while we don't have a surface, we won't
         // get the callbacks that actually set mZoom.
         if (sRollo == null || !mHaveSurface) {
-            mZoomDirty = true;
+            sZoomDirty = true;
             mZoom = zoom;
         } else {
             sRollo.setZoom(zoom, animate);
@@ -959,7 +960,7 @@
             sRollo.mScrollPos = ((float)mData[0]) / (1 << 16);
             mVelocity = ((float)mData[1]) / (1 << 16);
             mZoom = ((float)mData[2]) / (1 << 16);
-            mZoomDirty = false;
+            sZoomDirty = false;
         }
     }
 
@@ -1305,8 +1306,8 @@
         }
 
         void dirtyCheck() {
-            if (mAllApps.mZoomDirty) {
-                setZoom(mAllApps.mNextZoom, mAllApps.mAnimateNextZoom);
+            if (sZoomDirty) {
+                setZoom(mAllApps.sNextZoom, mAllApps.sAnimateNextZoom);
             }
         }
 
@@ -1612,8 +1613,8 @@
         Log.d(TAG, "mVelocityTracker=" + mVelocityTracker);
         Log.d(TAG, "mTouchTracking=" + mTouchTracking);
         Log.d(TAG, "mShouldGainFocus=" + mShouldGainFocus);
-        Log.d(TAG, "mZoomDirty=" + mZoomDirty);
-        Log.d(TAG, "mAnimateNextZoom=" + mAnimateNextZoom);
+        Log.d(TAG, "sZoomDirty=" + sZoomDirty);
+        Log.d(TAG, "sAnimateNextZoom=" + sAnimateNextZoom);
         Log.d(TAG, "mZoom=" + mZoom);
         Log.d(TAG, "mScrollPos=" + sRollo.mScrollPos);
         Log.d(TAG, "mVelocity=" + mVelocity);
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index b82e0cf..5cfcac2 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1750,6 +1750,10 @@
      *          - Go back with back key  TODO: make this not go to workspace
      *          - From all apps
      *          - From workspace
+     *   - Enter and exit car mode (becuase it causes an extra configuration changed)
+     *          - From all apps
+     *          - From the center workspace
+     *          - From another workspace
      */
     void closeAllApps(boolean animated) {
         if (mAllAppsGrid.isVisible()) {