diff --git a/quickstep/src/com/android/quickstep/BaseContainerInterface.java b/quickstep/src/com/android/quickstep/BaseContainerInterface.java index fdb3740c3f..f26d9a9d88 100644 --- a/quickstep/src/com/android/quickstep/BaseContainerInterface.java +++ b/quickstep/src/com/android/quickstep/BaseContainerInterface.java @@ -153,6 +153,13 @@ public abstract class BaseContainerInterface() // Use overview input consumer for sharesheets on top of home. val forceOverviewInputConsumer = - gestureState.getContainerInterface().isStarted() && - runningTask != null && - runningTask.isRootChooseActivity + container.isStarted() && runningTask != null && runningTask.isRootChooseActivity if (!Flags.enableShellTopTaskTracking()) { // In the case where we are in an excluded, translucent overlay, ignore it and treat the @@ -550,18 +549,17 @@ object InputConsumerUtils { // with shell-transitions, home is resumed during recents animation, so // explicitly check against recents animation too. val launcherResumedThroughShellTransition = - (gestureState.getContainerInterface().isResumed() && - !previousGestureState.isRecentsAnimationRunning) + container.isResumed() && !previousGestureState.isRecentsAnimationRunning // If a task fragment within Launcher is resumed val launcherChildActivityResumed = (com.android.launcher3.Flags.useActivityOverlay() && runningTask != null && runningTask.isHomeTask && - overviewComponentObserver.isHomeAndOverviewSameActivity && - !launcherResumedThroughShellTransition && - !previousGestureState.isRecentsAnimationRunning) + !previousGestureState.isRecentsAnimationRunning && + overviewComponentObserver.isHomeAndOverviewSame && + container.isLauncherOverlayShowing) - return if (gestureState.getContainerInterface().isInLiveTileMode()) { + return if (container.isInLiveTileMode()) { createOverviewInputConsumer( userUnlocked, taskAnimationManager, diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java index fa8e4846b3..96194124b0 100644 --- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java +++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java @@ -358,4 +358,11 @@ public final class LauncherActivityInterface extends return NORMAL; } } + + @Override + public boolean isLauncherOverlayShowing() { + Launcher launcher = Launcher.ACTIVITY_TRACKER.getCreatedContext(); + + return launcher != null && launcher.getWorkspace().isOverlayShown(); + } } diff --git a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java index 9c4239807b..a94dd82b57 100644 --- a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java +++ b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java @@ -301,10 +301,6 @@ public final class OverviewComponentObserver { return mIsHomeAndOverviewSame; } - public boolean isHomeAndOverviewSameActivity() { - return isHomeAndOverviewSame() && !enableLauncherOverviewInWindow.isTrue(); - } - /** * Get the current control helper for managing interactions to the overview container for * the given displayId. diff --git a/quickstep/tests/src/com/android/quickstep/InputConsumerUtilsTest.java b/quickstep/tests/src/com/android/quickstep/InputConsumerUtilsTest.java index 8a6aa5fb49..617658fd3d 100644 --- a/quickstep/tests/src/com/android/quickstep/InputConsumerUtilsTest.java +++ b/quickstep/tests/src/com/android/quickstep/InputConsumerUtilsTest.java @@ -297,7 +297,8 @@ public class InputConsumerUtilsTest { @Test public void testNewBaseConsumer_launcherChildActivityResumed_returnsDefaultInputConsumer() { when(mRunningTask.isHomeTask()).thenReturn(true); - when(mOverviewComponentObserver.isHomeAndOverviewSameActivity()).thenReturn(true); + when(mOverviewComponentObserver.isHomeAndOverviewSame()).thenReturn(true); + when(mContainerInterface.isLauncherOverlayShowing()).thenReturn(true); assertEqualsDefaultInputConsumer(this::createBaseInputConsumer); }