Merge "Fully null check mRecentsAnimationController" into sc-dev am: d61f224570
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15147296
Change-Id: I88d51d664b00ec21145281782612045fc6297663
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index deeaaa6..99ad8c0 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -140,7 +140,8 @@
private final ArrayList<Runnable> mRecentsAnimationStartCallbacks = new ArrayList<>();
private final OnScrollChangedListener mOnRecentsScrollListener = this::onRecentsViewScroll;
- protected RecentsAnimationController mRecentsAnimationController;
+ // Null if the recents animation hasn't started yet or has been canceled or finished.
+ protected @Nullable RecentsAnimationController mRecentsAnimationController;
protected RecentsAnimationTargets mRecentsAnimationTargets;
protected T mActivity;
protected Q mRecentsView;
@@ -1354,8 +1355,10 @@
@UiThread
private void resumeLastTask() {
- mRecentsAnimationController.finish(false /* toRecents */, null);
- ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", false);
+ if (mRecentsAnimationController != null) {
+ mRecentsAnimationController.finish(false /* toRecents */, null);
+ ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", false);
+ }
doLogGesture(LAST_TASK, null);
reset();
}
@@ -1663,13 +1666,17 @@
}
} else {
mActivityInterface.onLaunchTaskFailed();
- mRecentsAnimationController.finish(true /* toRecents */, null);
+ if (mRecentsAnimationController != null) {
+ mRecentsAnimationController.finish(true /* toRecents */, null);
+ }
}
}, true /* freezeTaskList */);
} else {
mActivityInterface.onLaunchTaskFailed();
Toast.makeText(mContext, R.string.activity_not_available, LENGTH_SHORT).show();
- mRecentsAnimationController.finish(true /* toRecents */, null);
+ if (mRecentsAnimationController != null) {
+ mRecentsAnimationController.finish(true /* toRecents */, null);
+ }
}
}
mCanceled = false;