From 2829c361f3790fe18655bfc47ffe6da1fea0f543 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 31 Jan 2024 10:43:45 -0800 Subject: [PATCH] Blocking gestureNav on taskFragments within the Launcher activity Bug: 273828110 Flag: aconfig use_activity_overlay disabled Test: Verified on device Change-Id: Ie812e17012feb8e99e06d0593207a87ef0c768e3 --- .../quickstep/TouchInteractionService.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 55a7985598..79f9392a85 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -24,6 +24,7 @@ import static android.view.MotionEvent.ACTION_POINTER_UP; import static android.view.MotionEvent.ACTION_UP; import static com.android.launcher3.Flags.enableCursorHoverStates; +import static com.android.launcher3.Flags.useActivityOverlay; import static com.android.launcher3.Launcher.INTENT_ACTION_ALL_APPS_TOGGLE; import static com.android.launcher3.LauncherPrefs.backedUpItem; import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; @@ -1148,6 +1149,14 @@ public class TouchInteractionService extends Service { boolean launcherResumedThroughShellTransition = gestureState.getActivityInterface().isResumed() && !previousGestureState.isRecentsAnimationRunning(); + // If a task fragment within Launcher is resumed + boolean launcherChildActivityResumed = useActivityOverlay() + && runningTask != null + && runningTask.isHomeTask() + && mOverviewComponentObserver.isHomeAndOverviewSame() + && !launcherResumedThroughShellTransition + && !previousGestureState.isRecentsAnimationRunning(); + if (gestureState.getActivityInterface().isInLiveTileMode()) { return createOverviewInputConsumer( previousGestureState, @@ -1174,9 +1183,11 @@ public class TouchInteractionService extends Service { ? "launcher resumed through a shell transition" : "forceOverviewInputConsumer == true")) .append(", trying to use overview input consumer")); - } else if (mDeviceState.isGestureBlockedTask(runningTask)) { + } else if (mDeviceState.isGestureBlockedTask(runningTask) || launcherChildActivityResumed) { return getDefaultInputConsumer(reasonString.append(SUBSTRING_PREFIX) - .append("is gesture-blocked task, trying to use default input consumer")); + .append(launcherChildActivityResumed + ? "is launcher child-task, trying to use default input consumer" + : "is gesture-blocked task, trying to use default input consumer")); } else { reasonString.append(SUBSTRING_PREFIX) .append("using OtherActivityInputConsumer");