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

Commit 4351e700 authored by Bruno Martins's avatar Bruno Martins
Browse files

ButtonBacklightBrightness: Restore disabled keyboard backlight code

Change-Id: I7b1604602e79829ff18bbe8dd2e7d2de9869f00d
parent 70bba8bc
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -67,13 +67,11 @@ public class ButtonBacklightBrightness extends CustomDialogPreference<AlertDialo

        setDialogLayoutResource(R.layout.button_backlight);

        /*
        if (isKeyboardSupported(context)) {
            mKeyboardBrightness = new BrightnessControl(
                    LineageSettings.Secure.KEYBOARD_BRIGHTNESS, false);
            mActiveControl = mKeyboardBrightness;
        }
        */
        if (isButtonSupported(context)) {
            boolean isSingleValue = !context.getResources().getBoolean(
                    com.android.internal.R.bool.config_deviceHasVariableButtonBrightness);
@@ -239,12 +237,10 @@ public class ButtonBacklightBrightness extends CustomDialogPreference<AlertDialo
        return hasBacklightKey && hasBacklight;
    }

    /*
    public static boolean isKeyboardSupported(Context context) {
        return context.getResources().getInteger(
                com.android.internal.R.integer.config_keyboardBrightnessSettingDefault) > 0;
    }
    */

    public void updateSummary() {
        if (mButtonBrightness != null) {
+2 −2
Original line number Diff line number Diff line
@@ -399,7 +399,7 @@ public class ButtonSettings extends SettingsPreferenceFragment

        final ButtonBacklightBrightness backlight = findPreference(KEY_BUTTON_BACKLIGHT);
        if (!backlight.isButtonSupported(getActivity())
                /*&& !backlight.isKeyboardSupported(getActivity())*/) {
                && !backlight.isKeyboardSupported(getActivity())) {
            prefScreen.removePreference(backlight);
        }

@@ -842,7 +842,7 @@ public class ButtonSettings extends SettingsPreferenceFragment
            }

            if (!ButtonBacklightBrightness.isButtonSupported(context)
                    /*&& !backlight.isKeyboardSupported(getActivity())*/) {
                    && !ButtonBacklightBrightness.isKeyboardSupported(context)) {
                result.add(KEY_BUTTON_BACKLIGHT);
            }