Don't rely on intent to call back from activity tracker
- The intent is not updated in certain cases which means that the callback may not be made if Launcher gets recreated. Instead have the tracker manage the set of registered callbacks. - This change allows AbsSwipeUpHandler to continue to receive onActivityInit calls even if Launcher restarts, and also to handle a case where restarting while waiting for a page-settling callback will continue to finish the gesture. Bug: 183962705 Test: Force recreate at various points in the gesture Change-Id: Ib5ead8c868e798e26e56776f57bd715c79d087cd
This commit is contained in:
1 parent
f2ec20325b
commit
1c2d522d1b
10 files changed
+62
-60
No files matched your search
@@ -389,8 +389,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
|
||||
mInteractionHandler = mHandlerFactory.newHandler(mGestureState, touchTimeMs);
|
||||
mInteractionHandler.setGestureEndCallback(this::onInteractionGestureFinished);
|
||||
mMotionPauseDetector.setOnMotionPauseListener(mInteractionHandler.getMotionPauseListener());
|
||||
Intent intent = new Intent(mInteractionHandler.getLaunchIntent());
|
||||
mInteractionHandler.initWhenReady(intent);
|
||||
mInteractionHandler.initWhenReady();
|
||||
|
||||
if (mTaskAnimationManager.isRecentsAnimationRunning()) {
|
||||
mActiveCallbacks = mTaskAnimationManager.continueRecentsAnimation(mGestureState);
|
||||
@@ -398,6 +397,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
|
||||
mTaskAnimationManager.notifyRecentsAnimationState(mInteractionHandler);
|
||||
notifyGestureStarted(true /*isLikelyToStartNewTask*/);
|
||||
} else {
|
||||
Intent intent = new Intent(mInteractionHandler.getLaunchIntent());
|
||||
intent.putExtra(INTENT_EXTRA_LOG_TRACE_ID, mGestureState.getGestureId());
|
||||
mActiveCallbacks = mTaskAnimationManager.startRecentsAnimation(mGestureState, intent,
|
||||
mInteractionHandler);
|
||||
|
||||
Reference in new issue
Block a user