Merge "Add null check for mRecentsView when recents animation is canceled" into udc-qpr-dev

This commit is contained in:
Treehugger Robot
2023-08-21 21:50:54 +00:00
committed by Android (Google) Code Review

View File

@@ -518,20 +518,22 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
// Set up a entire animation lifecycle callback to notify the current recents view when
// the animation is canceled
mGestureState.runOnceAtState(STATE_RECENTS_ANIMATION_CANCELED, () -> {
HashMap<Integer, ThumbnailData> snapshots =
mGestureState.consumeRecentsAnimationCanceledSnapshot();
if (snapshots != null) {
mRecentsView.switchToScreenshot(snapshots, () -> {
if (mRecentsAnimationController != null) {
mRecentsAnimationController.cleanupScreenshot();
} else if (mDeferredCleanupRecentsAnimationController != null) {
mDeferredCleanupRecentsAnimationController.cleanupScreenshot();
mDeferredCleanupRecentsAnimationController = null;
}
});
mRecentsView.onRecentsAnimationComplete();
}
});
if (mRecentsView == null) return;
HashMap<Integer, ThumbnailData> snapshots =
mGestureState.consumeRecentsAnimationCanceledSnapshot();
if (snapshots != null) {
mRecentsView.switchToScreenshot(snapshots, () -> {
if (mRecentsAnimationController != null) {
mRecentsAnimationController.cleanupScreenshot();
} else if (mDeferredCleanupRecentsAnimationController != null) {
mDeferredCleanupRecentsAnimationController.cleanupScreenshot();
mDeferredCleanupRecentsAnimationController = null;
}
});
mRecentsView.onRecentsAnimationComplete();
}
});
setupRecentsViewUi();
mRecentsView.runOnPageScrollsInitialized(this::linkRecentsViewScroll);