launcher: check if task still exists before leaving it in focus

Fixes 191353942
Test: manually; check buganizer on how to reproduce

Change-Id: Ia75ff59b5a9ef5654747d445df4088a5b17f6a42
This commit is contained in:
Thales Lima
2021-07-13 16:20:08 +01:00
parent cd777a3f45
commit 9c1024759f
@@ -1159,7 +1159,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
final TaskView taskView = (TaskView) getChildAt(pageIndex);
taskView.bind(task, mOrientationState);
}
if (mFocusedTaskId == -1 && getTaskViewCount() > 0) {
// If the list changed, maybe the focused task doesn't exist anymore
if (getFocusedTaskView() == null && getTaskViewCount() > 0) {
mFocusedTaskId = getTaskViewAt(0).getTaskId();
}
updateTaskSize();