diff options
author | 2025-03-07 18:22:59 +0000 | |
---|---|---|
committer | 2025-03-10 19:08:55 +0000 | |
commit | d94ca5754714c695bb7c334c084a1f3353ee6e84 (patch) | |
tree | d19ef41f2ecd7bf8e62c7ec60b3296509ae5a32d | |
parent | 2642bfb210a4c5bcab1d84e060f075d79571cd6a (diff) |
Move flags to desktopmodeflag
Flag: com.android.launcher3.enable_fallback_overview_in_window
Flag: com.android.launcher3.enable_launcher_overview_in_window
Flag: com.android.launcher3.enable_state_manager_proto_log
Flag: com.android.launcher3.enable_recents_window_proto_log
Test: built and ran locally with flags on and off
Bug: b/401073215
Bug: b/401073401
Bug: b/401075030
Bug: b/401076625
Change-Id: I1bd2822d20f677445610b912dd82ff160bff4143
15 files changed, 91 insertions, 59 deletions
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java index cc340ce7fe..bee0997d16 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java @@ -15,8 +15,8 @@ */ package com.android.launcher3.taskbar; -import static android.content.Context.RECEIVER_NOT_EXPORTED; import static android.content.Context.RECEIVER_EXPORTED; +import static android.content.Context.RECEIVER_NOT_EXPORTED; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL; @@ -25,6 +25,7 @@ import static com.android.launcher3.Flags.enableGrowthNudge; import static com.android.launcher3.Flags.enableUnfoldStateAnimation; import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION; import static com.android.launcher3.config.FeatureFlags.enableTaskbarNoRecreate; +import static com.android.launcher3.taskbar.growth.GrowthConstants.BROADCAST_SHOW_NUDGE; import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY; import static com.android.launcher3.util.DisplayController.CHANGE_DESKTOP_MODE; import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE; @@ -32,7 +33,6 @@ import static com.android.launcher3.util.DisplayController.CHANGE_SHOW_LOCKED_TA import static com.android.launcher3.util.DisplayController.CHANGE_TASKBAR_PINNING; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.launcher3.util.FlagDebugUtils.formatFlagChange; -import static com.android.launcher3.taskbar.growth.GrowthConstants.BROADCAST_SHOW_NUDGE; import static com.android.quickstep.util.SystemActionConstants.ACTION_SHOW_TASKBAR; import static com.android.quickstep.util.SystemActionConstants.SYSTEM_ACTION_ID_TASKBAR; @@ -81,6 +81,7 @@ import com.android.quickstep.AllAppsActionManager; import com.android.quickstep.RecentsActivity; import com.android.quickstep.SystemUiProxy; import com.android.quickstep.fallback.window.RecentsDisplayModel; +import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.fallback.window.RecentsWindowManager; import com.android.quickstep.util.ContextualSearchInvoker; import com.android.quickstep.util.GroupTask; @@ -628,7 +629,7 @@ public class TaskbarManager { /** Creates a {@link TaskbarUIController} to use with non default displays. */ private TaskbarUIController createTaskbarUIControllerForNonDefaultDisplay(int displayId) { debugPrimaryTaskbar("createTaskbarUIControllerForNonDefaultDisplay"); - if (RecentsDisplayModel.enableOverviewInWindow()) { + if (RecentsWindowFlags.Companion.getEnableOverviewInWindow()) { RecentsViewContainer rvc = mRecentsDisplayModel.getRecentsWindowManager(displayId); if (rvc != null) { return createTaskbarUIControllerForRecentsViewContainer(rvc); diff --git a/quickstep/src/com/android/quickstep/GestureState.java b/quickstep/src/com/android/quickstep/GestureState.java index 74aa8e2150..c4ba2d52bb 100644 --- a/quickstep/src/com/android/quickstep/GestureState.java +++ b/quickstep/src/com/android/quickstep/GestureState.java @@ -38,10 +38,10 @@ import android.window.TransitionInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.android.launcher3.Flags; import com.android.launcher3.statemanager.BaseState; import com.android.launcher3.statemanager.StatefulContainer; import com.android.quickstep.TopTaskTracker.CachedTaskInfo; +import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.util.ActiveGestureErrorDetector; import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.util.ActiveGestureProtoLogProxy; @@ -323,8 +323,7 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL */ public boolean useSyntheticRecentsTransition() { return mRunningTask.isHomeTask() - && (Flags.enableFallbackOverviewInWindow() - || Flags.enableLauncherOverviewInWindow()); + && RecentsWindowFlags.Companion.getEnableOverviewInWindow(); } /** diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt b/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt index 984f390721..bf87291f10 100644 --- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt +++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt @@ -30,9 +30,7 @@ import androidx.annotation.UiThread import androidx.annotation.VisibleForTesting import com.android.internal.jank.Cuj import com.android.launcher3.Flags.enableAltTabKqsOnConnectedDisplays -import com.android.launcher3.Flags.enableFallbackOverviewInWindow import com.android.launcher3.Flags.enableLargeDesktopWindowingTile -import com.android.launcher3.Flags.enableLauncherOverviewInWindow import com.android.launcher3.Flags.enableOverviewCommandHelperTimeout import com.android.launcher3.PagedView import com.android.launcher3.logger.LauncherAtom @@ -53,6 +51,7 @@ import com.android.quickstep.OverviewCommandHelper.CommandType.KEYBOARD_INPUT import com.android.quickstep.OverviewCommandHelper.CommandType.SHOW import com.android.quickstep.OverviewCommandHelper.CommandType.TOGGLE import com.android.quickstep.fallback.window.RecentsDisplayModel +import com.android.quickstep.fallback.window.RecentsWindowFlags.Companion.enableOverviewInWindow import com.android.quickstep.util.ActiveGestureLog import com.android.quickstep.util.ActiveGestureProtoLogProxy import com.android.quickstep.views.RecentsView @@ -299,7 +298,7 @@ constructor( val focusedDisplayId = focusState.focusedDisplayId val focusedDisplayUIController: TaskbarUIController? = - if (RecentsDisplayModel.enableOverviewInWindow()) { + if (enableOverviewInWindow) { Log.d( TAG, "Querying RecentsDisplayModel for TaskbarUIController for display: $focusedDisplayId", @@ -392,9 +391,7 @@ constructor( return false } - val recentsInWindowFlagSet = - enableFallbackOverviewInWindow() || enableLauncherOverviewInWindow() - if (!recentsInWindowFlagSet) { + if (!enableOverviewInWindow) { containerInterface.getCreatedContainer()?.rootView?.let { view -> InteractionJankMonitorWrapper.begin(view, Cuj.CUJ_LAUNCHER_QUICK_SWITCH) } @@ -425,7 +422,7 @@ constructor( transitionInfo: TransitionInfo?, ) { Log.d(TAG, "recents animation started: $command") - if (recentsInWindowFlagSet) { + if (enableOverviewInWindow) { containerInterface.getCreatedContainer()?.rootView?.let { view -> InteractionJankMonitorWrapper.begin(view, Cuj.CUJ_LAUNCHER_QUICK_SWITCH) } diff --git a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java index 7eacef3d86..7d3a1da76f 100644 --- a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java +++ b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java @@ -24,6 +24,7 @@ import static android.view.Display.DEFAULT_DISPLAY; import static com.android.launcher3.Flags.enableOverviewOnConnectedDisplays; import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVITY; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; +import static com.android.quickstep.fallback.window.RecentsWindowFlags.enableLauncherOverviewInWindow; import static com.android.systemui.shared.system.PackageManagerWrapper.ACTION_PREFERRED_ACTIVITY_CHANGED; import android.content.ActivityNotFoundException; @@ -41,7 +42,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.android.launcher3.Flags; import com.android.launcher3.R; import com.android.launcher3.dagger.ApplicationContext; import com.android.launcher3.dagger.LauncherAppComponent; @@ -50,6 +50,7 @@ import com.android.launcher3.util.DaggerSingletonObject; import com.android.launcher3.util.DaggerSingletonTracker; import com.android.launcher3.util.SimpleBroadcastReceiver; import com.android.quickstep.fallback.window.RecentsDisplayModel; +import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.util.ActiveGestureProtoLogProxy; import com.android.systemui.shared.system.PackageManagerWrapper; @@ -180,7 +181,7 @@ public final class OverviewComponentObserver { mDefaultDisplayContainerInterface.onAssistantVisibilityChanged(0.f); } - if (SEPARATE_RECENTS_ACTIVITY.get() || Flags.enableLauncherOverviewInWindow()) { + if (SEPARATE_RECENTS_ACTIVITY.get() || enableLauncherOverviewInWindow.isTrue()) { mIsDefaultHome = false; if (defaultHome == null) { defaultHome = mMyHomeIntent.getComponent(); @@ -203,7 +204,7 @@ public final class OverviewComponentObserver { unregisterOtherHomeAppUpdateReceiver(); } else { // The default home app is a different launcher. Use the fallback Overview instead. - if (Flags.enableLauncherOverviewInWindow() || Flags.enableFallbackOverviewInWindow()) { + if (RecentsWindowFlags.Companion.getEnableOverviewInWindow()) { mDefaultDisplayContainerInterface = mRecentsDisplayModel.getFallbackWindowInterface(DEFAULT_DISPLAY); } else { diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java index d7152b5928..ecde37b986 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java @@ -34,9 +34,9 @@ import androidx.annotation.BinderThread; import androidx.annotation.NonNull; import androidx.annotation.UiThread; -import com.android.launcher3.Flags; import com.android.launcher3.Utilities; import com.android.launcher3.util.Preconditions; +import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.util.ActiveGestureProtoLogProxy; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.RecentsAnimationControllerCompat; @@ -113,8 +113,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() - || Flags.enableLauncherOverviewInWindow()) || isOpeningHome)) { + if (appCount == 0 && (!RecentsWindowFlags.Companion.getEnableOverviewInWindow() + || 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 64a8c251b1..1c7f23c25d 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -42,12 +42,12 @@ import androidx.annotation.Nullable; import androidx.annotation.UiThread; import com.android.internal.util.ArrayUtils; -import com.android.launcher3.Flags; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.taskbar.TaskbarUIController; import com.android.launcher3.util.DisplayController; import com.android.quickstep.fallback.window.RecentsDisplayModel; +import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.fallback.window.RecentsWindowManager; import com.android.quickstep.util.ActiveGestureProtoLogProxy; import com.android.quickstep.util.SystemUiFlagUtils; @@ -63,7 +63,6 @@ import java.util.HashMap; public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAnimationListener { public static final boolean SHELL_TRANSITIONS_ROTATION = SystemProperties.getBoolean("persist.wm.debug.shell_transit_rotate", false); - private final Context mCtx; private RecentsAnimationController mController; private RecentsAnimationCallbacks mCallbacks; @@ -313,8 +312,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn } if(containerInterface.getCreatedContainer() instanceof RecentsWindowManager - && (Flags.enableFallbackOverviewInWindow() - || Flags.enableLauncherOverviewInWindow())) { + && RecentsWindowFlags.Companion.getEnableOverviewInWindow()) { mRecentsAnimationStartPending = getSystemUiProxy().startRecentsActivity(intent, options, mCallbacks, gestureState.useSyntheticRecentsTransition()); RecentsDisplayModel.getINSTANCE().get(mCtx) diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index ba662c45a8..741ae7dad5 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -94,6 +94,7 @@ import com.android.quickstep.OverviewCommandHelper.CommandType; import com.android.quickstep.OverviewComponentObserver.OverviewChangeListener; import com.android.quickstep.fallback.window.RecentsDisplayModel; import com.android.quickstep.fallback.window.RecentsDisplayModel.RecentsDisplayResource; +import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.fallback.window.RecentsWindowSwipeHandler; import com.android.quickstep.inputconsumers.BubbleBarInputConsumer; import com.android.quickstep.inputconsumers.OneHandedModeInputConsumer; @@ -1081,10 +1082,9 @@ public class TouchInteractionService extends Service { } public AbsSwipeUpHandler.Factory getSwipeUpHandlerFactory() { - boolean recentsInWindow = - Flags.enableFallbackOverviewInWindow() || Flags.enableLauncherOverviewInWindow(); return mOverviewComponentObserver.isHomeAndOverviewSame() - ? mLauncherSwipeHandlerFactory : (recentsInWindow + ? mLauncherSwipeHandlerFactory + : (RecentsWindowFlags.Companion.getEnableOverviewInWindow() ? mRecentsWindowSwipeHandlerFactory : mFallbackSwipeHandlerFactory); } diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index d8662f274d..8ec97edbd7 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -30,7 +30,6 @@ import android.view.MotionEvent; import androidx.annotation.Nullable; import com.android.launcher3.AbstractFloatingView; -import com.android.launcher3.Flags; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.desktop.DesktopRecentsTransitionController; @@ -46,6 +45,7 @@ import com.android.quickstep.FallbackActivityInterface; import com.android.quickstep.GestureState; import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle; import com.android.quickstep.fallback.window.RecentsDisplayModel; +import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.util.GroupTask; import com.android.quickstep.util.SingleTask; import com.android.quickstep.util.SplitSelectStateController; @@ -80,9 +80,10 @@ public class FallbackRecentsView<CONTAINER_TYPE extends Context & RecentsViewCon @Override public BaseContainerInterface<RecentsState, ?> getContainerInterface(int displayId) { - return (Flags.enableFallbackOverviewInWindow() || Flags.enableLauncherOverviewInWindow()) + return RecentsWindowFlags.Companion.getEnableOverviewInWindow() ? RecentsDisplayModel.getINSTANCE().get(mContext) - .getFallbackWindowInterface(displayId) : FallbackActivityInterface.INSTANCE; + .getFallbackWindowInterface(displayId) + : FallbackActivityInterface.INSTANCE; } @Override @@ -290,8 +291,7 @@ 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() - || Flags.enableLauncherOverviewInWindow())) { + if (isOverlayEnabled && !RecentsWindowFlags.Companion.getEnableOverviewInWindow()) { runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator().setDrawsBelowRecents(true)); } diff --git a/quickstep/src/com/android/quickstep/fallback/window/RecentsDisplayModel.kt b/quickstep/src/com/android/quickstep/fallback/window/RecentsDisplayModel.kt index 58c6c50776..12dc17775f 100644 --- a/quickstep/src/com/android/quickstep/fallback/window/RecentsDisplayModel.kt +++ b/quickstep/src/com/android/quickstep/fallback/window/RecentsDisplayModel.kt @@ -19,7 +19,6 @@ package com.android.quickstep.fallback.window import android.content.Context import android.view.Display import androidx.core.util.valueIterator -import com.android.launcher3.Flags import com.android.launcher3.dagger.ApplicationContext import com.android.launcher3.dagger.LauncherAppSingleton import com.android.launcher3.util.DaggerSingletonObject @@ -29,6 +28,7 @@ import com.android.quickstep.DisplayModel import com.android.quickstep.FallbackWindowInterface import com.android.quickstep.dagger.QuickstepBaseAppComponent import com.android.quickstep.fallback.window.RecentsDisplayModel.RecentsDisplayResource +import com.android.quickstep.fallback.window.RecentsWindowFlags.Companion.enableOverviewInWindow import java.io.PrintWriter import javax.inject.Inject @@ -50,14 +50,10 @@ constructor( DaggerSingletonObject<RecentsDisplayModel>( QuickstepBaseAppComponent::getRecentsDisplayModel ) - - @JvmStatic - fun enableOverviewInWindow() = - Flags.enableFallbackOverviewInWindow() || Flags.enableLauncherOverviewInWindow() } init { - if (enableOverviewInWindow()) { + if (enableOverviewInWindow) { registerDisplayListener() tracker.addCloseable { destroy() } } diff --git a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowContext.kt b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowContext.kt index 333571c234..d70d7eb094 100644 --- a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowContext.kt +++ b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowContext.kt @@ -18,7 +18,7 @@ package com.android.quickstep.fallback.window import android.content.Context import android.graphics.PixelFormat -import android.view.Display.DEFAULT_DISPLAY +import android.view.Display import android.view.ViewGroup import android.view.WindowManager import android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS @@ -53,7 +53,7 @@ abstract class RecentsWindowContext(windowContext: Context, wallpaperColorHints: fun initDeviceProfile() { deviceProfile = - if (displayId == DEFAULT_DISPLAY) + if (displayId == Display.DEFAULT_DISPLAY) InvariantDeviceProfile.INSTANCE[this].getDeviceProfile(this) else InvariantDeviceProfile.INSTANCE[this].createDeviceProfileForSecondaryDisplay(this) } diff --git a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowFlags.kt b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowFlags.kt new file mode 100644 index 0000000000..99531546f5 --- /dev/null +++ b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowFlags.kt @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.quickstep.fallback.window + +import android.window.DesktopModeFlags.DesktopModeFlag +import com.android.launcher3.Flags + +class RecentsWindowFlags { + companion object { + @JvmField + val enableLauncherOverviewInWindow: DesktopModeFlag = + DesktopModeFlag(Flags::enableLauncherOverviewInWindow, false) + + @JvmField + val enableFallbackOverviewInWindow: DesktopModeFlag = + DesktopModeFlag(Flags::enableFallbackOverviewInWindow, false) + + @JvmStatic + val enableOverviewInWindow + get() = enableLauncherOverviewInWindow.isTrue || enableFallbackOverviewInWindow.isTrue + } +} diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java index 7cae5b8336..c8cf58c1f9 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java @@ -42,7 +42,6 @@ import android.window.TransitionInfo; import androidx.annotation.UiThread; -import com.android.launcher3.Flags; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.testing.TestLogging; @@ -59,6 +58,7 @@ import com.android.quickstep.RecentsAnimationDeviceState; import com.android.quickstep.RecentsAnimationTargets; import com.android.quickstep.RotationTouchHelper; import com.android.quickstep.TaskAnimationManager; +import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.util.CachedEventDispatcher; import com.android.quickstep.util.MotionPauseDetector; import com.android.quickstep.util.NavBarPosition; @@ -438,10 +438,8 @@ 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 - boolean useHomeIntentForWindow = Flags.enableFallbackOverviewInWindow() - || Flags.enableLauncherOverviewInWindow(); - Intent intent = new Intent(useHomeIntentForWindow ? mInteractionHandler.getHomeIntent() - : mInteractionHandler.getLaunchIntent()); + Intent intent = new Intent(RecentsWindowFlags.Companion.getEnableOverviewInWindow() + ? mInteractionHandler.getHomeIntent() : mInteractionHandler.getLaunchIntent()); intent.putExtra(INTENT_EXTRA_LOG_TRACE_ID, mGestureState.getGestureId()); mActiveCallbacks = mTaskAnimationManager.startRecentsAnimation(mGestureState, intent, mInteractionHandler); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index c282e773e6..f5d0bfe5be 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -200,6 +200,7 @@ import com.android.quickstep.TaskOverlayFactory; import com.android.quickstep.TaskViewUtils; import com.android.quickstep.TopTaskTracker; import com.android.quickstep.ViewUtils; +import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.orientation.RecentsPagedOrientationHandler; import com.android.quickstep.recents.data.RecentTasksRepository; import com.android.quickstep.recents.data.RecentsDeviceProfileRepository; @@ -257,7 +258,6 @@ import java.util.Optional; import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; - /** * A list of recent tasks. * @@ -6026,7 +6026,7 @@ public abstract class RecentsView< // mSyncTransactionApplier doesn't get transferred over runActionOnRemoteHandles(remoteTargetHandle -> { final TransformParams params = remoteTargetHandle.getTransformParams(); - if (Flags.enableFallbackOverviewInWindow() || Flags.enableLauncherOverviewInWindow()) { + if (RecentsWindowFlags.Companion.getEnableOverviewInWindow()) { params.setHomeBuilderProxy((builder, app, transformParams) -> { mTmpMatrix.setScale( 1f, 1f, app.localBounds.exactCenterX(), app.localBounds.exactCenterY()); diff --git a/quickstep/src_protolog/com/android/launcher3/util/StateManagerProtoLogProxy.java b/quickstep/src_protolog/com/android/launcher3/util/StateManagerProtoLogProxy.java index c319cb1378..cb7254f1fe 100644 --- a/quickstep/src_protolog/com/android/launcher3/util/StateManagerProtoLogProxy.java +++ b/quickstep/src_protolog/com/android/launcher3/util/StateManagerProtoLogProxy.java @@ -16,22 +16,25 @@ package com.android.launcher3.util; -import static com.android.launcher3.Flags.enableStateManagerProtoLog; import static com.android.quickstep.util.QuickstepProtoLogGroup.LAUNCHER_STATE_MANAGER; import static com.android.quickstep.util.QuickstepProtoLogGroup.isProtoLogInitialized; +import android.window.DesktopModeFlags.DesktopModeFlag; + import androidx.annotation.NonNull; import com.android.internal.protolog.ProtoLog; +import com.android.launcher3.Flags; /** * Proxy class used for StateManager ProtoLog support. */ public class StateManagerProtoLogProxy { - + private static final DesktopModeFlag ENABLE_STATE_MANAGER_PROTO_LOG = + new DesktopModeFlag(Flags::enableStateManagerProtoLog, true); public static void logGoToState( @NonNull Object fromState, @NonNull Object toState, @NonNull String trace) { - if (!enableStateManagerProtoLog() || !isProtoLogInitialized()) return; + if (!ENABLE_STATE_MANAGER_PROTO_LOG.isTrue() || !isProtoLogInitialized()) return; ProtoLog.d(LAUNCHER_STATE_MANAGER, "StateManager.goToState: fromState: %s, toState: %s, partial trace:\n%s", fromState, @@ -41,7 +44,7 @@ public class StateManagerProtoLogProxy { public static void logCreateAtomicAnimation( @NonNull Object fromState, @NonNull Object toState, @NonNull String trace) { - if (!enableStateManagerProtoLog() || !isProtoLogInitialized()) return; + if (!ENABLE_STATE_MANAGER_PROTO_LOG.isTrue() || !isProtoLogInitialized()) return; ProtoLog.d(LAUNCHER_STATE_MANAGER, "StateManager.createAtomicAnimation: " + "fromState: %s, toState: %s, partial trace:\n%s", fromState, @@ -50,17 +53,17 @@ public class StateManagerProtoLogProxy { } public static void logOnStateTransitionStart(@NonNull Object state) { - if (!enableStateManagerProtoLog() || !isProtoLogInitialized()) return; + if (!ENABLE_STATE_MANAGER_PROTO_LOG.isTrue() || !isProtoLogInitialized()) return; ProtoLog.d(LAUNCHER_STATE_MANAGER, "StateManager.onStateTransitionStart: state: %s", state); } public static void logOnStateTransitionEnd(@NonNull Object state) { - if (!enableStateManagerProtoLog() || !isProtoLogInitialized()) return; + if (!ENABLE_STATE_MANAGER_PROTO_LOG.isTrue() || !isProtoLogInitialized()) return; ProtoLog.d(LAUNCHER_STATE_MANAGER, "StateManager.onStateTransitionEnd: state: %s", state); } public static void logCancelAnimation(boolean animationOngoing, @NonNull String trace) { - if (!enableStateManagerProtoLog() || !isProtoLogInitialized()) return; + if (!ENABLE_STATE_MANAGER_PROTO_LOG.isTrue() || !isProtoLogInitialized()) return; ProtoLog.d(LAUNCHER_STATE_MANAGER, "StateManager.cancelAnimation: animation ongoing: %b, partial trace:\n%s", animationOngoing, diff --git a/quickstep/src_protolog/com/android/quickstep/util/RecentsWindowProtoLogProxy.java b/quickstep/src_protolog/com/android/quickstep/util/RecentsWindowProtoLogProxy.java index 2c9ae33ab6..99888fb2a3 100644 --- a/quickstep/src_protolog/com/android/quickstep/util/RecentsWindowProtoLogProxy.java +++ b/quickstep/src_protolog/com/android/quickstep/util/RecentsWindowProtoLogProxy.java @@ -16,14 +16,16 @@ package com.android.quickstep.util; -import static com.android.launcher3.Flags.enableRecentsWindowProtoLog; import static com.android.quickstep.util.QuickstepProtoLogGroup.RECENTS_WINDOW; import static com.android.quickstep.util.QuickstepProtoLogGroup.isProtoLogInitialized; +import android.window.DesktopModeFlags; + import androidx.annotation.NonNull; import com.android.internal.protolog.ProtoLog; import com.android.internal.protolog.common.IProtoLogGroup; +import com.android.launcher3.Flags; /** * Proxy class used for Recents Window ProtoLog support. @@ -35,19 +37,20 @@ import com.android.internal.protolog.common.IProtoLogGroup; * method. Or, if an existing entry needs to be modified, simply update it here. */ public class RecentsWindowProtoLogProxy { - + private static final DesktopModeFlags.DesktopModeFlag ENABLE_RECENTS_WINDOW_PROTO_LOG = + new DesktopModeFlags.DesktopModeFlag(Flags::enableRecentsWindowProtoLog, true); public static void logOnStateSetStart(@NonNull String stateName) { - if (!enableRecentsWindowProtoLog() || !isProtoLogInitialized()) return; + if (!ENABLE_RECENTS_WINDOW_PROTO_LOG.isTrue() || !isProtoLogInitialized()) return; ProtoLog.d(RECENTS_WINDOW, "onStateSetStart: %s", stateName); } public static void logOnStateSetEnd(@NonNull String stateName) { - if (!enableRecentsWindowProtoLog() || !isProtoLogInitialized()) return; + if (!ENABLE_RECENTS_WINDOW_PROTO_LOG.isTrue() || !isProtoLogInitialized()) return; ProtoLog.d(RECENTS_WINDOW, "onStateSetEnd: %s", stateName); } public static void logStartRecentsWindow(boolean isShown, boolean windowViewIsNull) { - if (!enableRecentsWindowProtoLog() || !isProtoLogInitialized()) return; + if (!ENABLE_RECENTS_WINDOW_PROTO_LOG.isTrue() || !isProtoLogInitialized()) return; ProtoLog.d(RECENTS_WINDOW, "Starting recents window: isShow= %b, windowViewIsNull=%b", isShown, @@ -55,7 +58,7 @@ public class RecentsWindowProtoLogProxy { } public static void logCleanup(boolean isShown) { - if (!enableRecentsWindowProtoLog() || !isProtoLogInitialized()) return; + if (!ENABLE_RECENTS_WINDOW_PROTO_LOG.isTrue() || !isProtoLogInitialized()) return; ProtoLog.d(RECENTS_WINDOW, "Cleaning up recents window: isShow= %b", isShown); } } |