Loading libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java +3 −0 Original line number Diff line number Diff line Loading @@ -281,5 +281,8 @@ public class DesktopModeStatus { SystemProperties.Handle maxTaskLimitHandle = SystemProperties.find(MAX_TASK_LIMIT_SYS_PROP); pw.print(innerPrefix); pw.print("maxTaskLimit sysprop="); pw.println(maxTaskLimitHandle == null ? "null" : maxTaskLimitHandle.getInt(/* def= */ -1)); pw.print(innerPrefix); pw.print("showAppHandle config override="); pw.print(context.getResources().getBoolean(R.bool.config_enableAppHandle)); } } libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java +2 −2 Original line number Diff line number Diff line Loading @@ -636,7 +636,7 @@ public abstract class WMShellBaseModule { static Optional<FreeformComponents> provideFreeformComponents( @DynamicOverride Optional<FreeformComponents> freeformComponents, Context context) { if (FreeformComponents.isFreeformEnabled(context)) { if (FreeformComponents.requiresFreeformComponents(context)) { return freeformComponents; } return Optional.empty(); Loading Loading @@ -992,7 +992,7 @@ public abstract class WMShellBaseModule { // Lazy ensures that this provider will not be the cause the dependency is created // when it will not be returned due to the condition below. return desktopTasksController.flatMap((lazy) -> { if (DesktopModeStatus.canEnterDesktopMode(context)) { if (DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context)) { return Optional.of(lazy.get()); } return Optional.empty(); Loading libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +5 −4 Original line number Diff line number Diff line Loading @@ -307,7 +307,7 @@ public abstract class WMShellModule { Optional<DesktopActivityOrientationChangeHandler> desktopActivityOrientationHandler, FocusTransitionObserver focusTransitionObserver, DesktopModeEventLogger desktopModeEventLogger) { if (DesktopModeStatus.canEnterDesktopMode(context)) { if (DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context)) { return new DesktopModeWindowDecorViewModel( context, mainExecutor, Loading Loading @@ -406,7 +406,7 @@ public abstract class WMShellModule { Optional<TaskChangeListener> taskChangeListener) { // TODO(b/238217847): Temporarily add this check here until we can remove the dynamic // override for this controller from the base module ShellInit init = FreeformComponents.isFreeformEnabled(context) ? shellInit : null; ShellInit init = FreeformComponents.requiresFreeformComponents(context) ? shellInit : null; return new FreeformTaskListener( context, init, Loading Loading @@ -847,7 +847,7 @@ public abstract class WMShellModule { DisplayController displayController, ShellTaskOrganizer shellTaskOrganizer, ShellCommandHandler shellCommandHandler) { if (DesktopModeStatus.canEnterDesktopMode(context)) { if (DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context)) { return Optional.of( new DesktopImmersiveController( shellInit, Loading Loading @@ -1074,7 +1074,8 @@ public abstract class WMShellModule { ShellInit shellInit, RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer ) { if (!DesktopModeStatus.canEnterDesktopMode(context)) { if (!DesktopModeStatus.canEnterDesktopMode(context) && !DesktopModeStatus.overridesShowAppHandle(context)) { return Optional.empty(); } return Optional.of( Loading libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformComponents.java +9 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.Context; import android.provider.Settings; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.shared.desktopmode.DesktopModeStatus; import com.android.wm.shell.transition.Transitions; import java.util.Optional; Loading Loading @@ -59,4 +60,12 @@ public class FreeformComponents { || Settings.Global.getInt(context.getContentResolver(), DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT, 0) != 0; } /** * Freeform is enabled or we need the components to enable the app handle when desktop mode is * not enabled */ public static boolean requiresFreeformComponents(Context context) { return isFreeformEnabled(context) || DesktopModeStatus.overridesShowAppHandle(context); } } libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionObserver.java +1 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public class FreeformTaskTransitionObserver implements Transitions.TransitionObs mWindowDecorViewModel = windowDecorViewModel; mTaskChangeListener = taskChangeListener; mFocusTransitionObserver = focusTransitionObserver; if (FreeformComponents.isFreeformEnabled(context)) { if (FreeformComponents.requiresFreeformComponents(context)) { shellInit.addInitCallback(this::onInit, this); } } Loading Loading
libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java +3 −0 Original line number Diff line number Diff line Loading @@ -281,5 +281,8 @@ public class DesktopModeStatus { SystemProperties.Handle maxTaskLimitHandle = SystemProperties.find(MAX_TASK_LIMIT_SYS_PROP); pw.print(innerPrefix); pw.print("maxTaskLimit sysprop="); pw.println(maxTaskLimitHandle == null ? "null" : maxTaskLimitHandle.getInt(/* def= */ -1)); pw.print(innerPrefix); pw.print("showAppHandle config override="); pw.print(context.getResources().getBoolean(R.bool.config_enableAppHandle)); } }
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java +2 −2 Original line number Diff line number Diff line Loading @@ -636,7 +636,7 @@ public abstract class WMShellBaseModule { static Optional<FreeformComponents> provideFreeformComponents( @DynamicOverride Optional<FreeformComponents> freeformComponents, Context context) { if (FreeformComponents.isFreeformEnabled(context)) { if (FreeformComponents.requiresFreeformComponents(context)) { return freeformComponents; } return Optional.empty(); Loading Loading @@ -992,7 +992,7 @@ public abstract class WMShellBaseModule { // Lazy ensures that this provider will not be the cause the dependency is created // when it will not be returned due to the condition below. return desktopTasksController.flatMap((lazy) -> { if (DesktopModeStatus.canEnterDesktopMode(context)) { if (DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context)) { return Optional.of(lazy.get()); } return Optional.empty(); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +5 −4 Original line number Diff line number Diff line Loading @@ -307,7 +307,7 @@ public abstract class WMShellModule { Optional<DesktopActivityOrientationChangeHandler> desktopActivityOrientationHandler, FocusTransitionObserver focusTransitionObserver, DesktopModeEventLogger desktopModeEventLogger) { if (DesktopModeStatus.canEnterDesktopMode(context)) { if (DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context)) { return new DesktopModeWindowDecorViewModel( context, mainExecutor, Loading Loading @@ -406,7 +406,7 @@ public abstract class WMShellModule { Optional<TaskChangeListener> taskChangeListener) { // TODO(b/238217847): Temporarily add this check here until we can remove the dynamic // override for this controller from the base module ShellInit init = FreeformComponents.isFreeformEnabled(context) ? shellInit : null; ShellInit init = FreeformComponents.requiresFreeformComponents(context) ? shellInit : null; return new FreeformTaskListener( context, init, Loading Loading @@ -847,7 +847,7 @@ public abstract class WMShellModule { DisplayController displayController, ShellTaskOrganizer shellTaskOrganizer, ShellCommandHandler shellCommandHandler) { if (DesktopModeStatus.canEnterDesktopMode(context)) { if (DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context)) { return Optional.of( new DesktopImmersiveController( shellInit, Loading Loading @@ -1074,7 +1074,8 @@ public abstract class WMShellModule { ShellInit shellInit, RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer ) { if (!DesktopModeStatus.canEnterDesktopMode(context)) { if (!DesktopModeStatus.canEnterDesktopMode(context) && !DesktopModeStatus.overridesShowAppHandle(context)) { return Optional.empty(); } return Optional.of( Loading
libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformComponents.java +9 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.Context; import android.provider.Settings; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.shared.desktopmode.DesktopModeStatus; import com.android.wm.shell.transition.Transitions; import java.util.Optional; Loading Loading @@ -59,4 +60,12 @@ public class FreeformComponents { || Settings.Global.getInt(context.getContentResolver(), DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT, 0) != 0; } /** * Freeform is enabled or we need the components to enable the app handle when desktop mode is * not enabled */ public static boolean requiresFreeformComponents(Context context) { return isFreeformEnabled(context) || DesktopModeStatus.overridesShowAppHandle(context); } }
libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionObserver.java +1 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public class FreeformTaskTransitionObserver implements Transitions.TransitionObs mWindowDecorViewModel = windowDecorViewModel; mTaskChangeListener = taskChangeListener; mFocusTransitionObserver = focusTransitionObserver; if (FreeformComponents.isFreeformEnabled(context)) { if (FreeformComponents.requiresFreeformComponents(context)) { shellInit.addInitCallback(this::onInit, this); } } Loading