pressing home twice shows small overview mode

Change-Id: If5a6c0942685cd52ef77562dd342f28e16ae571c
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 6b00742..c4bb69e 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1,3 +1,4 @@
+
 /*
  * Copyright (C) 2008 The Android Open Source Project
  *
@@ -1110,16 +1111,20 @@
             boolean alreadyOnHome = ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
                         != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
             boolean allAppsVisible = isAllAppsVisible();
+            boolean customizationDrawerVisible = isCustomizationDrawerVisible();
+
 
             // in all these cases, only animate if we're already on home
             if (LauncherApplication.isScreenXLarge()) {
-                mWorkspace.unshrink(alreadyOnHome);
-            }
-            if (!mWorkspace.isDefaultScreenShowing()) {
+                if (alreadyOnHome && !mWorkspace.isSmall() &&
+                        !allAppsVisible && !customizationDrawerVisible) {
+                    mWorkspace.shrinkToMiddle();
+                } else {
+                    mWorkspace.unshrink(alreadyOnHome);
+                }
+            } else if (!mWorkspace.isDefaultScreenShowing()) {
                 // on the phone, we don't animate the change to the workspace if all apps is visible
-                // on xlarge screens, however, we want an animated transition
-                mWorkspace.moveToDefaultScreen(alreadyOnHome &&
-                        (LauncherApplication.isScreenXLarge() || !allAppsVisible));
+                mWorkspace.moveToDefaultScreen(alreadyOnHome && !allAppsVisible);
             }
             closeAllApps(alreadyOnHome && allAppsVisible);
             hideCustomizationDrawer();