From 9d7141d1fec310a83820534909243d741c03dfeb Mon Sep 17 00:00:00 2001 From: randypfohl Date: Wed, 23 Oct 2024 12:12:54 -0700 Subject: [PATCH] Enabling Fallback launcher cases Test: Locally tested and verified flow for fallback. Flag: com.android.launcher3.enable_launcher_overview_in_window Bug: 365777265 Change-Id: I991a82152b47f2cfb7c1335c699e297b8f53bcf3 --- quickstep/src/com/android/quickstep/GestureState.java | 4 +++- .../com/android/quickstep/OverviewComponentObserver.java | 4 ++-- .../com/android/quickstep/RecentsAnimationCallbacks.java | 3 ++- .../src/com/android/quickstep/TaskAnimationManager.java | 3 ++- .../src/com/android/quickstep/TouchInteractionService.java | 6 ++++-- .../com/android/quickstep/fallback/FallbackRecentsView.java | 5 +++-- .../inputconsumers/OtherActivityInputConsumer.java | 6 ++++-- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/quickstep/src/com/android/quickstep/GestureState.java b/quickstep/src/com/android/quickstep/GestureState.java index 015a449cc4..cff352cf16 100644 --- a/quickstep/src/com/android/quickstep/GestureState.java +++ b/quickstep/src/com/android/quickstep/GestureState.java @@ -309,7 +309,9 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL * changes in the WM hierarchy (ie. starting recents transition when you are already over home). */ public boolean useSyntheticRecentsTransition() { - return mRunningTask.isHomeTask() && Flags.enableFallbackOverviewInWindow(); + return mRunningTask.isHomeTask() + && (Flags.enableFallbackOverviewInWindow() + || Flags.enableLauncherOverviewInWindow()); } /** diff --git a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java index 66112c1768..1f6c6717d1 100644 --- a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java +++ b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java @@ -155,7 +155,7 @@ public final class OverviewComponentObserver { mContainerInterface.onAssistantVisibilityChanged(0.f); } - if (SEPARATE_RECENTS_ACTIVITY.get()) { + if (SEPARATE_RECENTS_ACTIVITY.get() || Flags.enableLauncherOverviewInWindow()) { mIsDefaultHome = false; if (defaultHome == null) { defaultHome = mMyHomeIntent.getComponent(); @@ -179,7 +179,7 @@ public final class OverviewComponentObserver { } else { // The default home app is a different launcher. Use the fallback Overview instead. - if (Flags.enableFallbackOverviewInWindow()) { + if (Flags.enableLauncherOverviewInWindow() || Flags.enableFallbackOverviewInWindow()) { mContainerInterface = FallbackWindowInterface.getInstance(); } else { mContainerInterface = FallbackActivityInterface.INSTANCE; diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java index 7d5bd377d0..8fc1a785ad 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java @@ -109,7 +109,8 @@ public class RecentsAnimationCallbacks implements boolean isOpeningHome = Arrays.stream(appTargets).filter(app -> app.mode == MODE_OPENING && app.windowConfiguration.getActivityType() == ACTIVITY_TYPE_HOME) .count() > 0; - if (appCount == 0 && (!Flags.enableFallbackOverviewInWindow() || isOpeningHome)) { + if (appCount == 0 && (!(Flags.enableFallbackOverviewInWindow() + || Flags.enableLauncherOverviewInWindow()) || isOpeningHome)) { ActiveGestureProtoLogProxy.logOnRecentsAnimationStartCancelled(); // Edge case, if there are no closing app targets, then Launcher has nothing to handle notifyAnimationCanceled(); diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java index 56c978a318..0b6794c15f 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -295,7 +295,8 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn // TODO:(b/365777482) if flag is enabled, but on launcher it will crash. if(containerInterface.getCreatedContainer() instanceof RecentsWindowManager - && Flags.enableFallbackOverviewInWindow()){ + && (Flags.enableFallbackOverviewInWindow() + || Flags.enableLauncherOverviewInWindow())) { mRecentsAnimationStartPending = getSystemUiProxy().startRecentsActivity(intent, options, mCallbacks, gestureState.useSyntheticRecentsTransition()); mRecentsWindowsManager.startRecentsWindow(mCallbacks); diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 1481ef2460..816258956f 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -675,7 +675,7 @@ public class TouchInteractionService extends Service { mDesktopVisibilityController = new DesktopVisibilityController(this); mTaskbarManager = new TaskbarManager( this, mAllAppsActionManager, mNavCallbacks, mDesktopVisibilityController); - if(Flags.enableFallbackOverviewInWindow()) { + if (Flags.enableLauncherOverviewInWindow() || Flags.enableFallbackOverviewInWindow()) { mRecentsWindowManager = new RecentsWindowManager(this); } mInputConsumer = InputConsumerController.getRecentsAnimationInputConsumer(); @@ -1410,8 +1410,10 @@ public class TouchInteractionService extends Service { } public AbsSwipeUpHandler.Factory getSwipeUpHandlerFactory() { + boolean recentsInWindow = + Flags.enableFallbackOverviewInWindow() || Flags.enableLauncherOverviewInWindow(); return mOverviewComponentObserver.isHomeAndOverviewSame() - ? mLauncherSwipeHandlerFactory : (Flags.enableFallbackOverviewInWindow() + ? mLauncherSwipeHandlerFactory : (recentsInWindow ? mRecentsWindowSwipeHandlerFactory : mFallbackSwipeHandlerFactory); } diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index 5a4c769af2..daad6b75e9 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -78,7 +78,7 @@ public class FallbackRecentsView getContainerInterface() { - return Flags.enableFallbackOverviewInWindow() + return (Flags.enableFallbackOverviewInWindow() || Flags.enableLauncherOverviewInWindow()) ? FallbackWindowInterface.getInstance() : FallbackActivityInterface.INSTANCE; } @@ -294,7 +294,8 @@ public class FallbackRecentsView remoteTargetHandle.getTaskViewSimulator().setDrawsBelowRecents(true)); } diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java index e19b338dba..c4198db15c 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java @@ -157,6 +157,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mStartDisplacement = continuingPreviousGesture ? 0 : -mTouchSlop; mDisableHorizontalSwipe = !mPassedPilferInputSlop && disableHorizontalSwipe; mRotationTouchHelper = mDeviceState.getRotationTouchHelper(); + } @Override @@ -426,8 +427,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC notifyGestureStarted(true /*isLikelyToStartNewTask*/); } else { // todo differentiate intent based on if we are on home or in app for overview in window - Intent intent = new Intent(Flags.enableFallbackOverviewInWindow() - ? mInteractionHandler.getHomeIntent() + boolean useHomeIntentForWindow = Flags.enableFallbackOverviewInWindow() + || Flags.enableLauncherOverviewInWindow(); + Intent intent = new Intent(useHomeIntentForWindow ? mInteractionHandler.getHomeIntent() : mInteractionHandler.getLaunchIntent()); intent.putExtra(INTENT_EXTRA_LOG_TRACE_ID, mGestureState.getGestureId()); mActiveCallbacks = mTaskAnimationManager.startRecentsAnimation(mGestureState, intent,