Merge "Enabling Fallback launcher cases" into main

This commit is contained in:
Randy Pfohl
2024-10-28 17:28:58 +00:00
committed by Android (Google) Code Review
7 changed files with 20 additions and 11 deletions
@@ -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());
}
/**
@@ -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;
@@ -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();
@@ -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);
@@ -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);
}
@@ -78,7 +78,7 @@ public class FallbackRecentsView<CONTAINER_TYPE extends Context & RecentsViewCon
}
private static BaseContainerInterface<RecentsState, ?> getContainerInterface() {
return Flags.enableFallbackOverviewInWindow()
return (Flags.enableFallbackOverviewInWindow() || Flags.enableLauncherOverviewInWindow())
? FallbackWindowInterface.getInstance()
: FallbackActivityInterface.INSTANCE;
}
@@ -294,7 +294,8 @@ public class FallbackRecentsView<CONTAINER_TYPE extends Context & RecentsViewCon
}
// disabling this so app icons aren't drawn on top of recent tasks.
if (isOverlayEnabled && !Flags.enableFallbackOverviewInWindow()) {
if (isOverlayEnabled && !(Flags.enableFallbackOverviewInWindow()
|| Flags.enableLauncherOverviewInWindow())) {
runActionOnRemoteHandles(remoteTargetHandle ->
remoteTargetHandle.getTaskViewSimulator().setDrawsBelowRecents(true));
}
@@ -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,