summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-09-28 12:00:07 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-09-28 12:42:55 -0700
commit85313735fa6fa1daede64f42151380a318d1170f (patch)
tree07a2ded4468a66ef488ea02769994808a2dc7d0a /src
parent1b7e9bc063117f53d053bec003da34079aa11380 (diff)
downloadandroid_packages_apps_Trebuchet-85313735fa6fa1daede64f42151380a318d1170f.tar.gz
android_packages_apps_Trebuchet-85313735fa6fa1daede64f42151380a318d1170f.tar.bz2
android_packages_apps_Trebuchet-85313735fa6fa1daede64f42151380a318d1170f.zip
Fixing the newIntent logic to check the state before it has been reset.
When home button is pressed, we reset all active state (close all-apps, folder, shortcuts menu). But we do not go to the default screen if the active state was non-zero (any of the containers were open). Change-Id: Ia9a06729d65767124471c5b793323a55d822210a
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/Launcher.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 2b64d42d2..52099158d 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1793,11 +1793,14 @@ public class Launcher extends Activity
}
super.onNewIntent(intent);
- // Close the menu
- Folder openFolder = mWorkspace.getOpenFolder();
boolean alreadyOnHome = mHasFocus && ((intent.getFlags() &
Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
!= Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
+
+ // Check this condition before handling isActionMain, as this will get reset.
+ boolean shouldMoveToDefaultScreen = alreadyOnHome &&
+ mState == State.WORKSPACE && getTopFloatingView() == null;
+
boolean isActionMain = Intent.ACTION_MAIN.equals(intent.getAction());
if (isActionMain) {
// also will cancel mWaitingForResult.
@@ -1852,10 +1855,10 @@ public class Launcher extends Activity
// as slow logic in the callbacks eat into the time the scroller expects for the snapToPage
// animation.
if (isActionMain) {
- boolean moveToDefaultScreen = mLauncherCallbacks != null ?
+ boolean callbackAllowsMoveToDefaultScreen = mLauncherCallbacks != null ?
mLauncherCallbacks.shouldMoveToDefaultScreenOnHomeIntent() : true;
- if (alreadyOnHome && mState == State.WORKSPACE && !mWorkspace.isTouchActive() &&
- openFolder == null && moveToDefaultScreen) {
+ if (shouldMoveToDefaultScreen && !mWorkspace.isTouchActive()
+ && callbackAllowsMoveToDefaultScreen) {
// We use this flag to suppress noisy callbacks above custom content state
// from onResume.