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

Commit d71197fc authored by Bruno Martins's avatar Bruno Martins
Browse files

ButtonSettings: Implement support for keyboard lights toggle mode only

Up until now, it was assumed that all devices with keyboard lights
had variable brightness control. Add support for those that only
support lights on / lights off.

Change-Id: If6c79411fd046efdea6554946b192cf2d135395a
(cherry picked and backported from commit ec491e41)
parent 4351e700
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -68,8 +68,11 @@ public class ButtonBacklightBrightness extends CustomDialogPreference<AlertDialo
        setDialogLayoutResource(R.layout.button_backlight);

        if (isKeyboardSupported(context)) {
            boolean isSingleValue = !context.getResources().getBoolean(
                    com.android.internal.R.bool.config_deviceHasVariableKeyboardBrightness);

            mKeyboardBrightness = new BrightnessControl(
                    LineageSettings.Secure.KEYBOARD_BRIGHTNESS, false);
                    LineageSettings.Secure.KEYBOARD_BRIGHTNESS, isSingleValue);
            mActiveControl = mKeyboardBrightness;
        }
        if (isButtonSupported(context)) {