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

Commit 5177da3b authored by Santos Cordon's avatar Santos Cordon
Browse files

Add SCREEN_BRIGHTNESS_FOR_VR to set of public settings.

This will allow the settings to be adjusted by any third party app,
just like SCREEN_BRIGHTNESS is today.

Additionally adds the default value to the SystemSettings database
on initial setup.

Test: After clean install check that the default value is in the DB via
  'adb shell settings get system screen_brightness_for_vr'
Test: Verify that SCREEN_BRIGHTNESS_FOR_VR can be changed by a 3rd party
  app with WRITE_SETTINGS permission.

Bug: 73090564
Change-Id: I93d167ab23652c39b0cf815eb40935be26b857a6
(cherry picked from commit 5956f49210f32b8ceabf860f904b5ca77ec9631c)
parent 1cf0b6cb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4127,6 +4127,7 @@ public final class Settings {
            PUBLIC_SETTINGS.add(DIM_SCREEN);
            PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
            PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
            PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
            PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
            PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
            PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
+3 −0
Original line number Diff line number Diff line
@@ -2300,6 +2300,9 @@ class DatabaseHelper extends SQLiteOpenHelper {
            loadIntegerSetting(stmt, Settings.System.SCREEN_BRIGHTNESS,
                    R.integer.def_screen_brightness);

            loadIntegerSetting(stmt, Settings.System.SCREEN_BRIGHTNESS_FOR_VR,
                    com.android.internal.R.integer.config_screenBrightnessForVrSettingDefault);

            loadBooleanSetting(stmt, Settings.System.SCREEN_BRIGHTNESS_MODE,
                    R.bool.def_screen_brightness_automatic_mode);