summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/notification/NotificationSettings.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/notification/NotificationSettings.java')
-rw-r--r--src/com/android/settings/notification/NotificationSettings.java29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/com/android/settings/notification/NotificationSettings.java b/src/com/android/settings/notification/NotificationSettings.java
index f513378..34e60e8 100644
--- a/src/com/android/settings/notification/NotificationSettings.java
+++ b/src/com/android/settings/notification/NotificationSettings.java
@@ -82,6 +82,8 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
private static final String KEY_LOCK_SCREEN_NOTIFICATIONS = "lock_screen_notifications";
private static final String KEY_NOTIFICATION_ACCESS = "manage_notification_access";
private static final String KEY_INCREASING_RING_VOLUME = "increasing_ring_volume";
+ private static final String KEY_NOTIFICATION_LIGHT = "notification_light";
+ private static final String KEY_BATTERY_LIGHT = "battery_light";
private static final String KEY_ZEN_ACCESS = "manage_zen_access";
private static final String KEY_ZEN_MODE = "zen_mode";
@@ -443,25 +445,14 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
// === Pulse notification light ===
private void initPulse(PreferenceCategory parent) {
- mNotificationPulse = (TwoStatePreference) parent.findPreference(KEY_NOTIFICATION_PULSE);
- if (mNotificationPulse == null) {
- Log.i(TAG, "Preference not found: " + KEY_NOTIFICATION_PULSE);
- return;
- }
- if (!getResources()
- .getBoolean(com.android.internal.R.bool.config_intrusiveNotificationLed)) {
- parent.removePreference(mNotificationPulse);
- } else {
- updatePulse();
- mNotificationPulse.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- final boolean val = (Boolean)newValue;
- return Settings.System.putInt(getContentResolver(),
- Settings.System.NOTIFICATION_LIGHT_PULSE,
- val ? 1 : 0);
- }
- });
+ if (!getResources().getBoolean(
+ com.android.internal.R.bool.config_intrusiveNotificationLed)) {
+ parent.removePreference(parent.findPreference(KEY_NOTIFICATION_LIGHT));
+ }
+ if (!getResources().getBoolean(
+ com.android.internal.R.bool.config_intrusiveBatteryLed)
+ || UserHandle.myUserId() != UserHandle.USER_OWNER) {
+ parent.removePreference(parent.findPreference(KEY_BATTERY_LIGHT));
}
}