summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-09-28 22:57:56 (GMT)
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-09-28 22:57:56 (GMT)
commit7bb7ead9f71d2fbee5f1373b84ebfde7f01acbe3 (patch)
treeed1bd0deb6fc4a39a7f73d7f71944c0e709ac34f
parent9311387a227d7bd894d880b897fb80ca34b39405 (diff)
parent85313735fa6fa1daede64f42151380a318d1170f (diff)
downloadandroid_packages_apps_Trebuchet-7bb7ead9f71d2fbee5f1373b84ebfde7f01acbe3.zip
android_packages_apps_Trebuchet-7bb7ead9f71d2fbee5f1373b84ebfde7f01acbe3.tar.gz
android_packages_apps_Trebuchet-7bb7ead9f71d2fbee5f1373b84ebfde7f01acbe3.tar.bz2
Merge "Fixing the newIntent logic to check the state before it has been reset." into ub-launcher3-calgary-polish
-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 d059da2..ae2b7ea 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1816,11 +1816,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.
@@ -1875,10 +1878,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.