Merge "Fix NPE if display is off and then removed" into sc-dev

This commit is contained in:
Riddle Hsu
2021-04-15 14:48:41 +00:00
committed by Android (Google) Code Review

View File

@@ -646,8 +646,12 @@ class TaskSnapshotController {
if (shouldDisableSnapshots()) {
return;
}
final DisplayContent displayContent = mService.mRoot.getDisplayContent(displayId);
if (displayContent == null) {
return;
}
mTmpTasks.clear();
mService.mRoot.getDisplayContent(displayId).forAllTasks(task -> {
displayContent.forAllTasks(task -> {
// Since RecentsAnimation will handle task snapshot while switching apps with the best
// capture timing (e.g. IME window capture), No need additional task capture while task
// is controlled by RecentsAnimation.