From e7a054ae2b468761d9d0e6dda5645fe859387dcd Mon Sep 17 00:00:00 2001 From: minch Date: Thu, 20 Mar 2025 01:46:23 +0000 Subject: Make sure the correct input consumer is created Let `isGestureBlockedTask` return false directly if `mGestureBlockingTaskId` is not valid. This can avoid the caller go to create incorrect InputConsumer when the chekcing `taskId` is also invalid. Bug: 402218420 Flag: EXEMPT bug fix Test: m Change-Id: Ia0cde8ee2b97fc92028458d01487d958f2e87a80 --- quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quickstep/src') diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java index 6710096688..9bf63a0ce7 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java @@ -18,6 +18,7 @@ package com.android.quickstep; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.view.Display.DEFAULT_DISPLAY; +import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static com.android.launcher3.MotionEventsUtils.isTrackpadScroll; import static com.android.launcher3.util.DisplayController.CHANGE_ALL; @@ -342,6 +343,9 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener, E * @return whether the given running task info matches the gesture-blocked task. */ public boolean isGestureBlockedTask(CachedTaskInfo taskInfo) { + if (mGestureBlockingTaskId == INVALID_TASK_ID) { + return false; + } if (com.android.wm.shell.Flags.enableShellTopTaskTracking()) { return taskInfo != null && taskInfo.topGroupedTaskContainsTask(mGestureBlockingTaskId); } else { -- cgit v1.2.3-59-g8ed1b