From 9c1024759ff026cb6b4303c701caadabb1ffc45d Mon Sep 17 00:00:00 2001 From: Thales Lima Date: Tue, 13 Jul 2021 16:20:08 +0100 Subject: [PATCH] launcher: check if task still exists before leaving it in focus Fixes 191353942 Test: manually; check buganizer on how to reproduce Change-Id: Ia75ff59b5a9ef5654747d445df4088a5b17f6a42 --- quickstep/src/com/android/quickstep/views/RecentsView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index ca4319354a..c3dd13f0b9 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1159,7 +1159,9 @@ public abstract class RecentsView 0) { + + // If the list changed, maybe the focused task doesn't exist anymore + if (getFocusedTaskView() == null && getTaskViewCount() > 0) { mFocusedTaskId = getTaskViewAt(0).getTaskId(); } updateTaskSize();