Revert^2 "Cancel gestures on launcher destroy"

f0de6cc2ca

Bug: 261816852
Fixes: 244593270
Fixes: 257976590
Fixes: 261504234
Test: FallbackRecentsTest#goToOverviewFromApp and FallbackRecentsTest#goToOverviewFromHome
Change-Id: If49a08fd62b99c9bbc007900b613b83747916f5f
This commit is contained in:
Schneider Victor-tulias
2022-12-12 06:23:34 -08:00
parent 788f8e09fe
commit 377eb40985
6 changed files with 66 additions and 5 deletions
@@ -50,6 +50,7 @@ import static com.android.quickstep.GestureState.STATE_RECENTS_SCROLLING_FINISHE
import static com.android.quickstep.MultiStateCallback.DEBUG_STATES;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.CANCEL_RECENTS_ANIMATION;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.EXPECTING_TASK_APPEARED;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.LAUNCHER_DESTROYED;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.ON_SETTLED_ON_END_TARGET;
import static com.android.quickstep.util.VibratorWrapper.OVERVIEW_HAPTIC;
import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD;
@@ -181,6 +182,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
if (mActivity != activity) {
return;
}
handleActivityDestroyed();
mRecentsView = null;
mActivity = null;
}
@@ -451,6 +453,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
if (mStateCallback.hasStates(STATE_HANDLER_INVALIDATED)) {
return false;
}
mStateCallback.resumeCallbacks();
T createdActivity = mActivityInterface.getCreatedActivity();
if (createdActivity != null) {
@@ -520,6 +523,15 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
return true;
}
private void handleActivityDestroyed() {
ActiveGestureLog.INSTANCE.addLog("Launcher activity destroyed", LAUNCHER_DESTROYED);
if (mActivityInterface.shouldCancelGestureOnDestroy()) {
onGestureCancelled();
} else {
mStateCallback.pauseCallbacks();
}
}
/**
* Return true if the window should be translated horizontally if the recents view scrolls
*/