Fix bug 2271894 - Odd animation when press home button from app that wasn't in center home screen

Now:
 - When you're on the workspace and you press home, it animates back to the middle
 - When you're in all apps and you press home, all apps animates out and the workspace
   doesn't animate to the middle (it just jumps there)
 - When you're in an app and you press home, it doesn't animate to the middle
 - When you're in an app and you press back, it still goes to the page you were on.

Don't look at the evil hack to make it move without animating.
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index d76c9a8..fb59017 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -819,7 +819,7 @@
     }
 
     void closeSystemDialogs() {
-        closeAllApps(false);
+        closeAllApps(true);
         getWindow().closeAllPanels();
 
         try {
@@ -854,11 +854,13 @@
             // for example onResume being called when the user pressed the 'back' button.
             mIsNewIntent = true;
 
+            boolean alreadyOnHome = ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
+                        != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
+            boolean allAppsVisible = isAllAppsVisible();
             if (!mWorkspace.isDefaultScreenShowing()) {
-                mWorkspace.moveToDefaultScreen();
+                mWorkspace.moveToDefaultScreen(alreadyOnHome && !allAppsVisible);
             }
-
-            closeAllApps(false);
+            closeAllApps(alreadyOnHome && allAppsVisible);
 
             final View v = getWindow().peekDecorView();
             if (v != null && v.getWindowToken() != null) {