Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38f5a068 authored by Yi Jiang's avatar Yi Jiang
Browse files

Moves Adaptive Sleep's settings from Settings.System to Settings.Secure

Test: atest AdaptiveSleepPreferenceControllerTest
Test: atest AdaptiveSleepDetailPreferenceControllerTest
Bug: 139319542

Change-Id: Icd09a3291214194179d49d4e68032ba04fdfd040
parent a540e1ee
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2986,6 +2986,7 @@ public final class Settings {
        private static final HashSet<String> MOVED_TO_SECURE;
        static {
            MOVED_TO_SECURE = new HashSet<>(30);
            MOVED_TO_SECURE.add(Secure.ADAPTIVE_SLEEP);
            MOVED_TO_SECURE.add(Secure.ANDROID_ID);
            MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
            MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
@@ -3928,6 +3929,7 @@ public final class Settings {
        /**
         * Control whether to enable adaptive sleep mode.
         * @deprecated Use {@link android.provider.Settings.Secure#ADAPTIVE_SLEEP} instead.
         * @hide
         */
        public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
@@ -4718,7 +4720,6 @@ public final class Settings {
            PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
            PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
            PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
            PUBLIC_SETTINGS.add(ADAPTIVE_SLEEP);
            PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
            PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
            PUBLIC_SETTINGS.add(VIBRATE_ON);
@@ -5771,6 +5772,12 @@ public final class Settings {
            return putStringForUser(cr, name, Float.toString(value), userHandle);
        }
        /**
         * Control whether to enable adaptive sleep mode.
         * @hide
         */
        public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
        /**
         * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
         * instead
+6 −1
Original line number Diff line number Diff line
@@ -80,6 +80,11 @@ message SecureSettingsProto {
    }
    optional Accessibility accessibility = 2;

    message AdaptiveSleep {
        optional SettingProto enabled = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional AdaptiveSleep adaptive_sleep = 78;

    // Origins for which browsers should allow geolocation by default.
    // The value is a space-separated list of origins.
    optional SettingProto allowed_geolocation_origins = 3;
@@ -574,5 +579,5 @@ message SecureSettingsProto {

    // Please insert fields in alphabetical order and group them into messages
    // if possible (to avoid reaching the method limit).
    // Next tag = 78;
    // Next tag = 79;
}
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ public class SecureSettings {
        Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
        Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
        Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
        Settings.Secure.ADAPTIVE_SLEEP,
        Settings.Secure.AUTOFILL_SERVICE,
        Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
        Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ public class SystemSettings {
        Settings.System.SCREEN_BRIGHTNESS_MODE,
        Settings.System.SCREEN_AUTO_BRIGHTNESS_ADJ,
        Settings.System.SCREEN_BRIGHTNESS_FOR_VR,
        Settings.System.ADAPTIVE_SLEEP,
        Settings.System.ADAPTIVE_SLEEP,             // moved to secure
        Settings.System.VIBRATE_INPUT_DEVICES,
        Settings.System.MODE_RINGER_STREAMS_AFFECTED,
        Settings.System.TEXT_AUTO_REPLACE,
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(
                Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.ADAPTIVE_SLEEP, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.AUTOFILL_SERVICE, NULLABLE_COMPONENT_NAME_VALIDATOR);
        VALIDATORS.put(
                Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
Loading