Loading core/java/android/provider/Settings.java +2 −2 Original line number Diff line number Diff line Loading @@ -4724,13 +4724,13 @@ public final class Settings { public static final String PEAK_REFRESH_RATE = "peak_refresh_rate"; /** * Control whether to stay awake on fold * Control lock behavior on fold * * If this isn't set, the system falls back to a device specific default. * @hide */ @Readable public static final String STAY_AWAKE_ON_FOLD = "stay_awake_on_fold"; public static final String FOLD_LOCK_BEHAVIOR = "fold_lock_behavior_setting"; /** * The amount of time in milliseconds before the device goes to sleep or begins Loading services/core/java/com/android/server/utils/FoldSettingWrapper.java→core/java/com/android/internal/util/SettingsWrapper.java +36 −0 Original line number Diff line number Diff line Loading @@ -14,35 +14,23 @@ * limitations under the License. */ package com.android.server.utils; package com.android.internal.util; import android.content.ContentResolver; import android.provider.Settings; /** * A wrapper class for the {@link Settings.System#STAY_AWAKE_ON_FOLD} setting. * * This class provides a convenient way to access the {@link Settings.System#STAY_AWAKE_ON_FOLD} * setting for testing. * A wrapper class for accessing and modifying system settings that would help with testing. */ public class FoldSettingWrapper { private final ContentResolver mContentResolver; public class SettingsWrapper { public FoldSettingWrapper(ContentResolver contentResolver) { mContentResolver = contentResolver; /** Retrieves the string value of a system setting */ public String getStringForUser(ContentResolver contentResolver, String name, int userHandle) { return Settings.System.getStringForUser(contentResolver, name, userHandle); } /** * Returns whether the device should remain awake after folding. */ public boolean shouldStayAwakeOnFold() { try { return (Settings.System.getIntForUser( mContentResolver, Settings.System.STAY_AWAKE_ON_FOLD, 0) == 1); } catch (Settings.SettingNotFoundException e) { return false; } /** Updates the string value of a system setting */ public String putStringForUser(ContentResolver contentResolver, String name, int userHandle) { return Settings.System.getStringForUser(contentResolver, name, userHandle); } } core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -925,6 +925,9 @@ without impacting power, performance, and app compatibility (e.g. protected content). --> <bool name="config_reduceBrightColorsAvailable">@bool/config_setColorTransformAccelerated</bool> <!-- Whether to show Fold lock behavior setting feature in Settings App --> <bool name="config_fold_lock_behavior">false</bool> <string-array name="config_reduceBrightColorsCoefficientsNonlinear"> <!-- a-coefficient --> <item>-0.4429953456</item> <!-- b-coefficient --> <item>-0.2434077725</item> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -343,6 +343,7 @@ <java-symbol type="string" name="config_defaultHealthConnectApp" /> <java-symbol type="bool" name="config_sendAudioBecomingNoisy" /> <java-symbol type="bool" name="config_enableScreenshotChord" /> <java-symbol type="bool" name="config_fold_lock_behavior" /> <java-symbol type="bool" name="config_enableWifiDisplay" /> <java-symbol type="bool" name="config_allowAnimationsInLowPowerMode" /> <java-symbol type="bool" name="config_useDevInputEventForAudioJack" /> Loading packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public class SystemSettings { Settings.System.TTY_MODE, Settings.System.MASTER_MONO, Settings.System.MASTER_BALANCE, Settings.System.STAY_AWAKE_ON_FOLD, Settings.System.FOLD_LOCK_BEHAVIOR, Settings.System.SOUND_EFFECTS_ENABLED, Settings.System.HAPTIC_FEEDBACK_ENABLED, Settings.System.POWER_SOUNDS_ENABLED, // moved to global Loading Loading
core/java/android/provider/Settings.java +2 −2 Original line number Diff line number Diff line Loading @@ -4724,13 +4724,13 @@ public final class Settings { public static final String PEAK_REFRESH_RATE = "peak_refresh_rate"; /** * Control whether to stay awake on fold * Control lock behavior on fold * * If this isn't set, the system falls back to a device specific default. * @hide */ @Readable public static final String STAY_AWAKE_ON_FOLD = "stay_awake_on_fold"; public static final String FOLD_LOCK_BEHAVIOR = "fold_lock_behavior_setting"; /** * The amount of time in milliseconds before the device goes to sleep or begins Loading
services/core/java/com/android/server/utils/FoldSettingWrapper.java→core/java/com/android/internal/util/SettingsWrapper.java +36 −0 Original line number Diff line number Diff line Loading @@ -14,35 +14,23 @@ * limitations under the License. */ package com.android.server.utils; package com.android.internal.util; import android.content.ContentResolver; import android.provider.Settings; /** * A wrapper class for the {@link Settings.System#STAY_AWAKE_ON_FOLD} setting. * * This class provides a convenient way to access the {@link Settings.System#STAY_AWAKE_ON_FOLD} * setting for testing. * A wrapper class for accessing and modifying system settings that would help with testing. */ public class FoldSettingWrapper { private final ContentResolver mContentResolver; public class SettingsWrapper { public FoldSettingWrapper(ContentResolver contentResolver) { mContentResolver = contentResolver; /** Retrieves the string value of a system setting */ public String getStringForUser(ContentResolver contentResolver, String name, int userHandle) { return Settings.System.getStringForUser(contentResolver, name, userHandle); } /** * Returns whether the device should remain awake after folding. */ public boolean shouldStayAwakeOnFold() { try { return (Settings.System.getIntForUser( mContentResolver, Settings.System.STAY_AWAKE_ON_FOLD, 0) == 1); } catch (Settings.SettingNotFoundException e) { return false; } /** Updates the string value of a system setting */ public String putStringForUser(ContentResolver contentResolver, String name, int userHandle) { return Settings.System.getStringForUser(contentResolver, name, userHandle); } }
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -925,6 +925,9 @@ without impacting power, performance, and app compatibility (e.g. protected content). --> <bool name="config_reduceBrightColorsAvailable">@bool/config_setColorTransformAccelerated</bool> <!-- Whether to show Fold lock behavior setting feature in Settings App --> <bool name="config_fold_lock_behavior">false</bool> <string-array name="config_reduceBrightColorsCoefficientsNonlinear"> <!-- a-coefficient --> <item>-0.4429953456</item> <!-- b-coefficient --> <item>-0.2434077725</item> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -343,6 +343,7 @@ <java-symbol type="string" name="config_defaultHealthConnectApp" /> <java-symbol type="bool" name="config_sendAudioBecomingNoisy" /> <java-symbol type="bool" name="config_enableScreenshotChord" /> <java-symbol type="bool" name="config_fold_lock_behavior" /> <java-symbol type="bool" name="config_enableWifiDisplay" /> <java-symbol type="bool" name="config_allowAnimationsInLowPowerMode" /> <java-symbol type="bool" name="config_useDevInputEventForAudioJack" /> Loading
packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public class SystemSettings { Settings.System.TTY_MODE, Settings.System.MASTER_MONO, Settings.System.MASTER_BALANCE, Settings.System.STAY_AWAKE_ON_FOLD, Settings.System.FOLD_LOCK_BEHAVIOR, Settings.System.SOUND_EFFECTS_ENABLED, Settings.System.HAPTIC_FEEDBACK_ENABLED, Settings.System.POWER_SOUNDS_ENABLED, // moved to global Loading