Load home properly even if AllSetActivity fails Go To Home Swipe.
If the user swipes to go home before the Launcher can startup properly,
the user will be stuck on a black screen after swiping up to go home
after reaching the AllSet page after completing the setup wizard. This
change forces the device to go home if the go to home swipe is going to
fail (aka if the Launcher hasn't finished initializing).
Bug: 261901912
Test: Manually verified the device doesn't get stuck like before. UX is
not perfect since the Launcher still needs to load for a few hundred
milliseconds, but the user doesn't get stuck on a black screen.
Change-Id: I8590e7ec1e341ba17db853900de7186284b07e93
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
index 45ffa1c..ab70272 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
@@ -20,6 +20,7 @@
import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_POSITIVE;
import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL;
import static com.android.quickstep.MultiStateCallback.DEBUG_STATES;
+import static com.android.quickstep.OverviewComponentObserver.startHomeIntentSafely;
import static com.android.quickstep.util.ActiveGestureLog.INTENT_EXTRA_LOG_TRACE_ID;
import android.animation.ObjectAnimator;
@@ -102,8 +103,7 @@
mStateCallback = new MultiStateCallback(STATE_NAMES);
mStateCallback.runOnceAtState(STATE_TARGET_RECEIVED | STATE_HANDLER_INVALIDATED,
this::endRemoteAnimation);
- mStateCallback.runOnceAtState(STATE_TARGET_RECEIVED | STATE_FLING_FINISHED,
- this::onFlingFinished);
+ mStateCallback.runOnceAtState(STATE_FLING_FINISHED, this::onFlingFinished);
mSwipeDetector = new SingleAxisSwipeDetector(mContext, this, VERTICAL);
mSwipeDetector.setDetectableScrollConditions(DIRECTION_POSITIVE, false);
@@ -159,10 +159,12 @@
}
private void onFlingFinished() {
+ boolean endToRecents = mFlingEndsOnHome == null ? true : mFlingEndsOnHome;
if (mRecentsAnimationController != null) {
- boolean endToRecents = mFlingEndsOnHome == null ? true : mFlingEndsOnHome;
mRecentsAnimationController.finishController(endToRecents /* toRecents */,
null /* callback */, false /* sendUserLeaveHint */);
+ } else if (endToRecents) {
+ startHomeIntentSafely(mContext, null);
}
}