Merge "Check if mRecentsAnimationController is null before switching to screenshot" into sc-dev

This commit is contained in:
Tracy Zhou
2021-05-11 20:44:17 +00:00
committed by Android (Google) Code Review

View File

@@ -3635,6 +3635,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);
}