From 58bd15c6ab8dd8e146bc2d73a019cc344fc7e29d Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 23 Feb 2024 11:57:21 +0000 Subject: [PATCH] Fix setContentAlpha skipping all TaskViews when runningTaskId is -1 - Currently when runningTaskId is -1, it can skips setting contentAlpha for all TaskViews if they haven't been loaded, this cause RecentsView to become empty in the bug - Can be reproduced with excludeFromRecents=true apps Bug: 324495241 Test: swipe up from an app that has excludeFromRecents=true, e.g. Volume Dialog, Home quick settings tile, and Routines widget; ensure RecentsView is visible after gesture settles Flag: None Change-Id: I9f1b4ffed6d09805c83c6e2241903c73d4ead9ad --- .../src/com/android/quickstep/views/RecentsView.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 0a55770bfe..7bfa5eddd1 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -4261,10 +4261,12 @@ public abstract class RecentsView= 0; i--) { TaskView child = requireTaskViewAt(i); int[] childTaskIds = child.getTaskIds(); - if (!mRunningTaskTileHidden || - (childTaskIds[0] != runningTaskId && childTaskIds[1] != runningTaskId)) { - child.setStableAlpha(alpha); + if (runningTaskId != INVALID_TASK_ID + && mRunningTaskTileHidden + && (childTaskIds[0] == runningTaskId || childTaskIds[1] == runningTaskId)) { + continue; } + child.setStableAlpha(alpha); } mClearAllButton.setContentAlpha(mContentAlpha); int alphaInt = Math.round(alpha * 255);