Refactor OverviewOnConnectedDisplays flag
and switch from DesktopModeFlags to DesktopExperienceFlags Bug: 413609179 Flag: EXEMPT refactor Test: local + presubmit Change-Id: I3b57e501bbf62400a9977ddcd2503be73f835b5a
This commit is contained in:
@@ -30,12 +30,12 @@ import com.android.app.displaylib.PerDisplayInstanceRepositoryImpl
|
||||
import com.android.app.displaylib.PerDisplayRepository
|
||||
import com.android.app.displaylib.SingleInstanceRepositoryImpl
|
||||
import com.android.app.displaylib.createDisplayLibComponent
|
||||
import com.android.launcher3.Flags.enableOverviewOnConnectedDisplays
|
||||
import com.android.launcher3.util.coroutines.DispatcherProvider
|
||||
import com.android.quickstep.FallbackWindowInterface
|
||||
import com.android.quickstep.RecentsAnimationDeviceState
|
||||
import com.android.quickstep.RotationTouchHelper
|
||||
import com.android.quickstep.TaskAnimationManager
|
||||
import com.android.quickstep.fallback.window.RecentsWindowFlags.enableOverviewOnConnectedDisplays
|
||||
import com.android.quickstep.fallback.window.RecentsWindowManager
|
||||
import com.android.quickstep.fallback.window.RecentsWindowManagerInstanceProvider
|
||||
import com.android.systemui.dagger.qualifiers.Background
|
||||
|
||||
@@ -730,7 +730,7 @@ public class TaskbarManagerImpl implements DisplayDecorationListener {
|
||||
/** Creates a {@link TaskbarUIController} to use with non default displays. */
|
||||
private TaskbarUIController createTaskbarUIControllerForNonDefaultDisplay(int displayId) {
|
||||
debugPrimaryTaskbar("createTaskbarUIControllerForNonDefaultDisplay");
|
||||
if (RecentsWindowFlags.Companion.getEnableOverviewInWindow()) {
|
||||
if (RecentsWindowFlags.getEnableOverviewInWindow()) {
|
||||
RecentsViewContainer rvc = mRecentsWindowManagerRepository.get(displayId);
|
||||
if (rvc != null) {
|
||||
return createTaskbarUIControllerForRecentsViewContainer(rvc);
|
||||
|
||||
@@ -323,7 +323,7 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL
|
||||
*/
|
||||
public boolean useSyntheticRecentsTransition() {
|
||||
return mRunningTask.isHomeTask()
|
||||
&& RecentsWindowFlags.Companion.getEnableOverviewInWindow();
|
||||
&& RecentsWindowFlags.getEnableOverviewInWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -52,7 +52,7 @@ import com.android.quickstep.OverviewCommandHelper.CommandType.SHOW_ALT_TAB
|
||||
import com.android.quickstep.OverviewCommandHelper.CommandType.SHOW_WITH_FOCUS
|
||||
import com.android.quickstep.OverviewCommandHelper.CommandType.TOGGLE
|
||||
import com.android.quickstep.OverviewCommandHelper.CommandType.TOGGLE_OVERVIEW_PREVIOUS
|
||||
import com.android.quickstep.fallback.window.RecentsWindowFlags.Companion.enableOverviewInWindow
|
||||
import com.android.quickstep.fallback.window.RecentsWindowFlags.enableOverviewInWindow
|
||||
import com.android.quickstep.util.ActiveGestureLog
|
||||
import com.android.quickstep.util.ActiveGestureProtoLogProxy
|
||||
import com.android.quickstep.views.RecentsView
|
||||
|
||||
@@ -21,11 +21,11 @@ import static android.content.Intent.ACTION_PACKAGE_CHANGED;
|
||||
import static android.content.Intent.ACTION_PACKAGE_REMOVED;
|
||||
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.enableFallbackOverviewInWindow;
|
||||
import static com.android.quickstep.fallback.window.RecentsWindowFlags.enableLauncherOverviewInWindow;
|
||||
import static com.android.quickstep.fallback.window.RecentsWindowFlags.enableOverviewOnConnectedDisplays;
|
||||
import static com.android.systemui.shared.system.PackageManagerWrapper.ACTION_PREFERRED_ACTIVITY_CHANGED;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
|
||||
@@ -113,7 +113,7 @@ 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 && (!RecentsWindowFlags.Companion.getEnableOverviewInWindow()
|
||||
if (appCount == 0 && (!RecentsWindowFlags.getEnableOverviewInWindow()
|
||||
|| isOpeningHome)) {
|
||||
ActiveGestureProtoLogProxy.logOnRecentsAnimationStartCancelled();
|
||||
// Edge case, if there are no closing app targets, then Launcher has nothing to handle
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.android.quickstep;
|
||||
|
||||
import static com.android.launcher3.Flags.enableOverviewOnConnectedDisplays;
|
||||
import static com.android.quickstep.fallback.window.RecentsWindowFlags.enableOverviewOnConnectedDisplays;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
|
||||
|
||||
if (containerInterface.getCreatedContainer()
|
||||
instanceof RecentsWindowManager recentsWindowManager
|
||||
&& RecentsWindowFlags.Companion.getEnableOverviewInWindow()) {
|
||||
&& RecentsWindowFlags.getEnableOverviewInWindow()) {
|
||||
mRecentsAnimationStartPending = getSystemUiProxy().startRecentsActivity(intent, options,
|
||||
mCallbacks, gestureState.useSyntheticRecentsTransition(), null, mDisplayId);
|
||||
recentsWindowManager.startRecentsWindow(mCallbacks);
|
||||
|
||||
@@ -24,7 +24,7 @@ import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
|
||||
import static android.view.Display.DEFAULT_DISPLAY;
|
||||
import static android.view.Display.INVALID_DISPLAY;
|
||||
|
||||
import static com.android.launcher3.Flags.enableOverviewOnConnectedDisplays;
|
||||
import static com.android.quickstep.fallback.window.RecentsWindowFlags.enableOverviewOnConnectedDisplays;
|
||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
|
||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_TYPE_A;
|
||||
import static com.android.wm.shell.Flags.enableShellTopTaskTracking;
|
||||
|
||||
@@ -24,7 +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.enableOverviewOnConnectedDisplays;
|
||||
import static com.android.quickstep.fallback.window.RecentsWindowFlags.enableOverviewOnConnectedDisplays;
|
||||
import static com.android.launcher3.LauncherPrefs.backedUpItem;
|
||||
import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent;
|
||||
import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe;
|
||||
|
||||
@@ -82,7 +82,7 @@ public class FallbackRecentsView<CONTAINER_TYPE extends Context & RecentsViewCon
|
||||
|
||||
@Override
|
||||
public BaseContainerInterface<RecentsState, ?> getContainerInterface(int displayId) {
|
||||
return RecentsWindowFlags.Companion.getEnableOverviewInWindow()
|
||||
return RecentsWindowFlags.getEnableOverviewInWindow()
|
||||
? FallbackWindowInterface.REPOSITORY_INSTANCE.get(mContext).get(displayId)
|
||||
: FallbackActivityInterface.INSTANCE;
|
||||
}
|
||||
@@ -309,7 +309,7 @@ public class FallbackRecentsView<CONTAINER_TYPE extends Context & RecentsViewCon
|
||||
}
|
||||
|
||||
// disabling this so app icons aren't drawn on top of recent tasks.
|
||||
if (isOverlayEnabled && !RecentsWindowFlags.Companion.getEnableOverviewInWindow()) {
|
||||
if (isOverlayEnabled && !RecentsWindowFlags.getEnableOverviewInWindow()) {
|
||||
mBlurUtils.setDrawLiveTileBelowRecents(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,28 +16,40 @@
|
||||
|
||||
package com.android.quickstep.fallback.window
|
||||
|
||||
import android.window.DesktopModeFlags.DesktopModeFlag
|
||||
import android.window.DesktopExperienceFlags.DesktopExperienceFlag
|
||||
import com.android.launcher3.Flags
|
||||
|
||||
class RecentsWindowFlags {
|
||||
companion object {
|
||||
@JvmField
|
||||
val enableLauncherOverviewInWindow: DesktopModeFlag =
|
||||
DesktopModeFlag(Flags::enableLauncherOverviewInWindow, false)
|
||||
object RecentsWindowFlags {
|
||||
@JvmField
|
||||
val enableLauncherOverviewInWindow: DesktopExperienceFlag =
|
||||
DesktopExperienceFlag(
|
||||
Flags::enableLauncherOverviewInWindow,
|
||||
false,
|
||||
Flags.FLAG_ENABLE_LAUNCHER_OVERVIEW_IN_WINDOW,
|
||||
)
|
||||
|
||||
@JvmField
|
||||
val enableFallbackOverviewInWindow: DesktopModeFlag =
|
||||
DesktopModeFlag(Flags::enableFallbackOverviewInWindow, false)
|
||||
@JvmField
|
||||
val enableFallbackOverviewInWindow: DesktopExperienceFlag =
|
||||
DesktopExperienceFlag(
|
||||
Flags::enableFallbackOverviewInWindow,
|
||||
false,
|
||||
Flags.FLAG_ENABLE_FALLBACK_OVERVIEW_IN_WINDOW,
|
||||
)
|
||||
|
||||
@JvmField
|
||||
val enableOverviewOnConnectedDisplays: DesktopModeFlag =
|
||||
DesktopModeFlag(Flags::enableOverviewOnConnectedDisplays, false)
|
||||
@JvmField
|
||||
val enableOverviewOnConnectedDisplays: DesktopExperienceFlag =
|
||||
DesktopExperienceFlag(
|
||||
Flags::enableOverviewOnConnectedDisplays,
|
||||
false,
|
||||
Flags.FLAG_ENABLE_OVERVIEW_ON_CONNECTED_DISPLAYS,
|
||||
)
|
||||
|
||||
@JvmStatic
|
||||
val enableOverviewInWindow
|
||||
get() =
|
||||
enableLauncherOverviewInWindow.isTrue ||
|
||||
enableFallbackOverviewInWindow.isTrue ||
|
||||
enableOverviewOnConnectedDisplays.isTrue
|
||||
}
|
||||
@JvmStatic
|
||||
val enableOverviewInWindow
|
||||
get() =
|
||||
enableLauncherOverviewInWindow.isTrue ||
|
||||
enableFallbackOverviewInWindow.isTrue ||
|
||||
enableOverviewOnConnectedDisplays.isTrue
|
||||
|
||||
@JvmStatic fun enableOverviewOnConnectedDisplays() = enableOverviewOnConnectedDisplays.isTrue
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import static android.view.Surface.ROTATION_180;
|
||||
import static android.view.Surface.ROTATION_270;
|
||||
import static android.view.Surface.ROTATION_90;
|
||||
|
||||
import static com.android.launcher3.Flags.enableOverviewOnConnectedDisplays;
|
||||
import static com.android.quickstep.fallback.window.RecentsWindowFlags.enableOverviewOnConnectedDisplays;
|
||||
import static com.android.launcher3.LauncherPrefs.ALLOW_ROTATION;
|
||||
import static com.android.launcher3.LauncherPrefs.FIXED_LANDSCAPE_MODE;
|
||||
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
|
||||
|
||||
@@ -5967,7 +5967,7 @@ public abstract class RecentsView<
|
||||
// mSyncTransactionApplier doesn't get transferred over
|
||||
runActionOnRemoteHandles(remoteTargetHandle -> {
|
||||
final TransformParams params = remoteTargetHandle.getTransformParams();
|
||||
if (RecentsWindowFlags.Companion.getEnableOverviewInWindow()) {
|
||||
if (RecentsWindowFlags.getEnableOverviewInWindow()) {
|
||||
params.setHomeBuilderProxy((builder, app, transformParams) -> {
|
||||
mTmpMatrix.setScale(
|
||||
1f, 1f, app.localBounds.exactCenterX(), app.localBounds.exactCenterY());
|
||||
|
||||
Reference in New Issue
Block a user