Merge "launcher: check if task still exists before leaving it in focus" into sc-v2-dev

This commit is contained in:
Thales Lima
2021-07-14 09:54:10 +00:00
committed by Android (Google) Code Review

View File

@@ -1158,7 +1158,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();