summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/ButtonSettings.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/ButtonSettings.java')
-rw-r--r--src/com/android/settings/ButtonSettings.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/settings/ButtonSettings.java b/src/com/android/settings/ButtonSettings.java
index 302a017a3..794bd117f 100644
--- a/src/com/android/settings/ButtonSettings.java
+++ b/src/com/android/settings/ButtonSettings.java
@@ -42,6 +42,7 @@ import com.android.internal.logging.MetricsLogger;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
+import com.android.settings.cyanogenmod.ButtonBacklightBrightness;
import org.cyanogenmod.hardware.KeyDisabler;
@@ -49,6 +50,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
Preference.OnPreferenceChangeListener {
private static final String TAG = "SystemSettings";
+ private static final String KEY_BUTTON_BACKLIGHT = "button_backlight";
private static final String KEY_HOME_LONG_PRESS = "hardware_keys_home_long_press";
private static final String KEY_HOME_DOUBLE_TAP = "hardware_keys_home_double_tap";
private static final String KEY_MENU_PRESS = "hardware_keys_menu_press";
@@ -311,6 +313,12 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
} catch (RemoteException e) {
Log.e(TAG, "Error getting navigation bar status");
}
+
+ final ButtonBacklightBrightness backlight =
+ (ButtonBacklightBrightness) findPreference(KEY_BUTTON_BACKLIGHT);
+ if (!backlight.isButtonSupported() && !backlight.isKeyboardSupported()) {
+ prefScreen.removePreference(backlight);
+ }
}
@Override
@@ -441,6 +449,15 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
(PreferenceCategory) prefScreen.findPreference(CATEGORY_ASSIST);
final PreferenceCategory appSwitchCategory =
(PreferenceCategory) prefScreen.findPreference(CATEGORY_APPSWITCH);
+ final ButtonBacklightBrightness backlight =
+ (ButtonBacklightBrightness) prefScreen.findPreference(KEY_BUTTON_BACKLIGHT);
+
+ /* Toggle backlight control depending on navbar state, force it to
+ off if enabling */
+ if (backlight != null) {
+ backlight.setEnabled(!enabled);
+ backlight.updateSummary();
+ }
/* Toggle hardkey control availability depending on navbar state */
if (homeCategory != null) {