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

Commit 613e5983 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

camera: Turn off max brightness by default

parent 4c908818
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -385,6 +385,13 @@ public class MainActivity extends AppCompatActivity {
            editor.apply();
        }

        boolean isFirstTimeMaxBrightness = sharedPreferences.getBoolean("isFirstTimeMaxBrightness", true);
        if (isFirstTimeMaxBrightness) {
            editor.putBoolean(PreferenceKeys.MaxBrightnessPreferenceKey, false);
            editor.putBoolean("isFirstTimeMaxBrightness", false);
            editor.apply();
        }

        // set up sensors
        mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);

@@ -3906,7 +3913,7 @@ public class MainActivity extends AppCompatActivity {
        // done here rather than onCreate, so that changing it in preferences takes effect without restarting app
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
        final WindowManager.LayoutParams layout = getWindow().getAttributes();
        if( force_max || sharedPreferences.getBoolean(PreferenceKeys.MaxBrightnessPreferenceKey, true) ) {
        if( force_max || sharedPreferences.getBoolean(PreferenceKeys.MaxBrightnessPreferenceKey, false) ) {
            layout.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_FULL;
        }
        else {
+1 −1
Original line number Diff line number Diff line
@@ -698,7 +698,7 @@
                android:key="preference_max_brightness"
                android:title="@string/preference_max_brightness"
                android:summary="@string/preference_max_brightness_summary"
                android:defaultValue="true"
                android:defaultValue="false"
                />

        </PreferenceScreen>