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

Commit 2facec37 authored by Annie Meng's avatar Annie Meng Committed by Android (Google) Code Review
Browse files

Merge "Don't backup/restore screen brightness"

parents 3b8040e4 931b41b7
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -3133,9 +3133,6 @@ public final class Settings {
         */
        public static final String SCREEN_BRIGHTNESS = "screen_brightness";

        private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
                new SettingsValidators.InclusiveIntegerRangeValidator(0, 255);

        /**
         * The screen backlight brightness between 0 and 255.
         * @hide
@@ -4068,7 +4065,6 @@ public final class Settings {
            FONT_SCALE,
            DIM_SCREEN,
            SCREEN_OFF_TIMEOUT,
            SCREEN_BRIGHTNESS,
            SCREEN_BRIGHTNESS_MODE,
            SCREEN_AUTO_BRIGHTNESS_ADJ,
            SCREEN_BRIGHTNESS_FOR_VR,
@@ -4238,7 +4234,6 @@ public final class Settings {
            VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
            VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
            VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
            VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
            VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
            VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
            VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ public class SettingsBackupTest {
                    Settings.System.POINTER_LOCATION, // backup candidate?
                    Settings.System.DEBUG_ENABLE_ENHANCED_CALL_BLOCKING, // used for testing only
                    Settings.System.RINGTONE_CACHE, // internal cache
                    Settings.System.SCREEN_BRIGHTNESS, // removed in P
                    Settings.System.SETUP_WIZARD_HAS_RUN, // Only used by SuW
                    Settings.System.SHOW_GTALK_SERVICE_STATUS, // candidate for backup?
                    Settings.System.SHOW_TOUCHES, // bug?
+1 −8
Original line number Diff line number Diff line
@@ -144,10 +144,7 @@ public class SettingsHelper {
        }

        try {
            if (Settings.System.SCREEN_BRIGHTNESS.equals(name)) {
                setBrightness(Integer.parseInt(value));
                // fall through to the ordinary write to settings
            } else if (Settings.System.SOUND_EFFECTS_ENABLED.equals(name)) {
            if (Settings.System.SOUND_EFFECTS_ENABLED.equals(name)) {
                setSoundEffects(Integer.parseInt(value) == 1);
                // fall through to the ordinary write to settings
            } else if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) {
@@ -305,10 +302,6 @@ public class SettingsHelper {
        }
    }

    private void setBrightness(int brightness) {
        mContext.getSystemService(DisplayManager.class).setTemporaryBrightness(brightness);
    }

    /* package */ byte[] getLocaleData() {
        Configuration conf = mContext.getResources().getConfiguration();
        return conf.getLocales().toLanguageTags().getBytes();