Loading core/java/android/window/DesktopExperienceFlags.java +3 −10 Original line number Diff line number Diff line Loading @@ -411,16 +411,9 @@ public enum DesktopExperienceFlags { /** Returns whether the toggle is overridden by the relevant system property.. */ private static boolean isToggleOverriddenBySystem() { // We never override if display content mode management is enabled. if (enableDisplayContentModeManagement()) { return false; } final Context context = getApplicationContext(); if (context == null) { return false; } // If the developer option is not supported, we don't override. if (!isDesktopExperienceDevOptionSupported()) { // We never override if display content mode management is enabled or // if the desktop experience dev option is not enabled in the build. if (enableDisplayContentModeManagement() || !Flags.showDesktopExperienceDevOption()) { return false; } return SystemProperties.getBoolean(SYSTEM_PROPERTY_NAME, false); Loading core/java/android/window/DesktopModeFlags.java +1 −1 Original line number Diff line number Diff line Loading @@ -260,7 +260,7 @@ public enum DesktopModeFlags { * Returns {@link ToggleOverride} from Settings.Global set by toggle. */ private static ToggleOverride getToggleOverrideFromSystem() { if (DesktopExperienceFlags.isDesktopExperienceDevOptionSupported()) { if (Flags.showDesktopExperienceDevOption()) { if (DesktopExperienceFlags.getToggleOverride()) { return ToggleOverride.OVERRIDE_ON; } Loading core/tests/coretests/src/android/window/DesktopModeFlagsTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -505,7 +505,7 @@ public class DesktopModeFlagsTest { } private boolean showDesktopWindowingDevOpts() { return Flags.showDesktopWindowingDevOption() && !showDesktopExperienceDevOpts(); return Flags.showDesktopWindowingDevOption() && !Flags.showDesktopExperienceDevOption(); } private boolean showDesktopExperienceDevOpts() { Loading @@ -513,7 +513,7 @@ public class DesktopModeFlagsTest { } private boolean showAnyDevOpts() { return Flags.showDesktopWindowingDevOption() || showDesktopExperienceDevOpts(); return Flags.showDesktopWindowingDevOption() || Flags.showDesktopExperienceDevOption(); } private void setDesktopModeSupported(boolean isSupported) { Loading libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java +16 −5 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class DesktopModeStatus { */ public static boolean canShowDesktopExperienceDevOption(@NonNull Context context) { return Flags.showDesktopExperienceDevOption() && isDeviceEligibleForDesktopMode(context); && isDeviceEligibleForDesktopExperienceDevOption(context); } /** Returns if desktop mode dev option should be enabled if there is no user override. */ Loading Loading @@ -222,11 +222,9 @@ public class DesktopModeStatus { } /** * Return {@code true} if the developer option for desktop mode is unrestricted and is supported * in the device. * Return {@code true} if the developer option for desktop mode is supported on this device. * * Note that, if {@link #isDeviceEligibleForDesktopMode(Context)} is true, then * {@link #isDeviceEligibleForDesktopModeDevOption(Context)} is also true. * <p> This method doesn't check if the developer option flag is enabled or not. */ private static boolean isDeviceEligibleForDesktopModeDevOption(@NonNull Context context) { if (!enforceDeviceRestrictions()) { Loading @@ -237,6 +235,19 @@ public class DesktopModeStatus { return desktopModeSupported || isDesktopModeDevOptionSupported(context); } /** * Return {@code true} if the developer option for desktop experience is supported on this * device. * * <p> This method doesn't check if the developer option flag is enabled or not. */ private static boolean isDeviceEligibleForDesktopExperienceDevOption(@NonNull Context context) { if (!enforceDeviceRestrictions()) { return true; } return isDesktopModeSupported(context) || isDesktopModeDevOptionSupported(context); } /** * @return {@code true} if this device has an internal large screen */ Loading libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopStateImpl.kt +4 −1 Original line number Diff line number Diff line Loading @@ -73,8 +73,11 @@ class DesktopStateImpl(context: Context) : DesktopState { desktopModeEnabled || isDesktopModeEnabledByDevOption } private val isDeviceEligibleForDesktopExperienceDevOption = !enforceDeviceRestrictions || isDesktopModeSupported || isDesktopModeDevOptionSupported override val canShowDesktopExperienceDevOption: Boolean = Flags.showDesktopExperienceDevOption() && isDeviceEligibleForDesktopMode Flags.showDesktopExperienceDevOption() && isDeviceEligibleForDesktopExperienceDevOption override val enterDesktopByDefaultOnFreeformDisplay: Boolean = DesktopExperienceFlags.ENABLE_DESKTOP_FIRST_BASED_DEFAULT_TO_DESKTOP_BUGFIX.isTrue || Loading Loading
core/java/android/window/DesktopExperienceFlags.java +3 −10 Original line number Diff line number Diff line Loading @@ -411,16 +411,9 @@ public enum DesktopExperienceFlags { /** Returns whether the toggle is overridden by the relevant system property.. */ private static boolean isToggleOverriddenBySystem() { // We never override if display content mode management is enabled. if (enableDisplayContentModeManagement()) { return false; } final Context context = getApplicationContext(); if (context == null) { return false; } // If the developer option is not supported, we don't override. if (!isDesktopExperienceDevOptionSupported()) { // We never override if display content mode management is enabled or // if the desktop experience dev option is not enabled in the build. if (enableDisplayContentModeManagement() || !Flags.showDesktopExperienceDevOption()) { return false; } return SystemProperties.getBoolean(SYSTEM_PROPERTY_NAME, false); Loading
core/java/android/window/DesktopModeFlags.java +1 −1 Original line number Diff line number Diff line Loading @@ -260,7 +260,7 @@ public enum DesktopModeFlags { * Returns {@link ToggleOverride} from Settings.Global set by toggle. */ private static ToggleOverride getToggleOverrideFromSystem() { if (DesktopExperienceFlags.isDesktopExperienceDevOptionSupported()) { if (Flags.showDesktopExperienceDevOption()) { if (DesktopExperienceFlags.getToggleOverride()) { return ToggleOverride.OVERRIDE_ON; } Loading
core/tests/coretests/src/android/window/DesktopModeFlagsTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -505,7 +505,7 @@ public class DesktopModeFlagsTest { } private boolean showDesktopWindowingDevOpts() { return Flags.showDesktopWindowingDevOption() && !showDesktopExperienceDevOpts(); return Flags.showDesktopWindowingDevOption() && !Flags.showDesktopExperienceDevOption(); } private boolean showDesktopExperienceDevOpts() { Loading @@ -513,7 +513,7 @@ public class DesktopModeFlagsTest { } private boolean showAnyDevOpts() { return Flags.showDesktopWindowingDevOption() || showDesktopExperienceDevOpts(); return Flags.showDesktopWindowingDevOption() || Flags.showDesktopExperienceDevOption(); } private void setDesktopModeSupported(boolean isSupported) { Loading
libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java +16 −5 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class DesktopModeStatus { */ public static boolean canShowDesktopExperienceDevOption(@NonNull Context context) { return Flags.showDesktopExperienceDevOption() && isDeviceEligibleForDesktopMode(context); && isDeviceEligibleForDesktopExperienceDevOption(context); } /** Returns if desktop mode dev option should be enabled if there is no user override. */ Loading Loading @@ -222,11 +222,9 @@ public class DesktopModeStatus { } /** * Return {@code true} if the developer option for desktop mode is unrestricted and is supported * in the device. * Return {@code true} if the developer option for desktop mode is supported on this device. * * Note that, if {@link #isDeviceEligibleForDesktopMode(Context)} is true, then * {@link #isDeviceEligibleForDesktopModeDevOption(Context)} is also true. * <p> This method doesn't check if the developer option flag is enabled or not. */ private static boolean isDeviceEligibleForDesktopModeDevOption(@NonNull Context context) { if (!enforceDeviceRestrictions()) { Loading @@ -237,6 +235,19 @@ public class DesktopModeStatus { return desktopModeSupported || isDesktopModeDevOptionSupported(context); } /** * Return {@code true} if the developer option for desktop experience is supported on this * device. * * <p> This method doesn't check if the developer option flag is enabled or not. */ private static boolean isDeviceEligibleForDesktopExperienceDevOption(@NonNull Context context) { if (!enforceDeviceRestrictions()) { return true; } return isDesktopModeSupported(context) || isDesktopModeDevOptionSupported(context); } /** * @return {@code true} if this device has an internal large screen */ Loading
libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopStateImpl.kt +4 −1 Original line number Diff line number Diff line Loading @@ -73,8 +73,11 @@ class DesktopStateImpl(context: Context) : DesktopState { desktopModeEnabled || isDesktopModeEnabledByDevOption } private val isDeviceEligibleForDesktopExperienceDevOption = !enforceDeviceRestrictions || isDesktopModeSupported || isDesktopModeDevOptionSupported override val canShowDesktopExperienceDevOption: Boolean = Flags.showDesktopExperienceDevOption() && isDeviceEligibleForDesktopMode Flags.showDesktopExperienceDevOption() && isDeviceEligibleForDesktopExperienceDevOption override val enterDesktopByDefaultOnFreeformDisplay: Boolean = DesktopExperienceFlags.ENABLE_DESKTOP_FIRST_BASED_DEFAULT_TO_DESKTOP_BUGFIX.isTrue || Loading