Loading core/java/android/window/DesktopExperienceFlags.java +14 −3 Original line number Diff line number Diff line Loading @@ -487,12 +487,23 @@ 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 or // if the desktop experience dev option is not enabled in the build. if (enableDisplayContentModeManagement() || !Flags.showDesktopExperienceDevOption()) { // We never override if display content mode management is enabled (except when desktop // mode dev option is enabled on the device, which indicates that the device only supports // desktop mode) or if the desktop experience dev option is not enabled in the build. if ((enableDisplayContentModeManagement() && (!isDesktopModeDevOptionSupported())) || !Flags.showDesktopExperienceDevOption()) { return false; } return SystemProperties.getBoolean(SYSTEM_PROPERTY_NAME, false); } private static boolean isDesktopModeDevOptionSupported() { Context context = getApplicationContext(); if (context == null) { return false; } return context.getResources().getBoolean(R.bool.config_isDesktopModeDevOptionSupported); } } Loading
core/java/android/window/DesktopExperienceFlags.java +14 −3 Original line number Diff line number Diff line Loading @@ -487,12 +487,23 @@ 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 or // if the desktop experience dev option is not enabled in the build. if (enableDisplayContentModeManagement() || !Flags.showDesktopExperienceDevOption()) { // We never override if display content mode management is enabled (except when desktop // mode dev option is enabled on the device, which indicates that the device only supports // desktop mode) or if the desktop experience dev option is not enabled in the build. if ((enableDisplayContentModeManagement() && (!isDesktopModeDevOptionSupported())) || !Flags.showDesktopExperienceDevOption()) { return false; } return SystemProperties.getBoolean(SYSTEM_PROPERTY_NAME, false); } private static boolean isDesktopModeDevOptionSupported() { Context context = getApplicationContext(); if (context == null) { return false; } return context.getResources().getBoolean(R.bool.config_isDesktopModeDevOptionSupported); } }