Check if mRecentsAnimationController is null before switching to screenshot

Fixes: 187738762
Test: N/A
Change-Id: I3e24a6136a4ed6ff0b0ab810310aaf9dd9dbbb7b
This commit is contained in:
Tracy Zhou
2021-05-10 13:40:04 -07:00
parent bcf85de807
commit 09aa748b7d
@@ -3607,6 +3607,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
* capturing the snapshot at the same time.
*/
public void switchToScreenshot(Runnable onFinishRunnable) {
if (mRecentsAnimationController == null) {
if (onFinishRunnable != null) {
onFinishRunnable.run();
}
return;
}
switchToScreenshot(mRunningTaskId == -1 ? null
: mRecentsAnimationController.screenshotTask(mRunningTaskId), onFinishRunnable);
}