summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/values/cm_strings.xml1
-rw-r--r--res/xml/notification_light_settings.xml5
-rw-r--r--src/com/android/settings/notificationlight/NotificationLightSettings.java10
3 files changed, 16 insertions, 0 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 8d0335f..044f0a2 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -311,6 +311,7 @@
<string name="notification_light_voicemail_title">Voicemail</string>
<string name="notification_light_brightness" translatable="false">@string/brightness</string>
<string name="notification_light_screen_on">Lights with screen on</string>
+ <string name="notification_light_use_multiple_leds">Multiple LEDs</string>
<string name="keywords_lights_brightness_level">dim leds brightness</string>
<!-- Lights settings, LED notification -->
diff --git a/res/xml/notification_light_settings.xml b/res/xml/notification_light_settings.xml
index 4737097..94600a3 100644
--- a/res/xml/notification_light_settings.xml
+++ b/res/xml/notification_light_settings.xml
@@ -46,6 +46,11 @@
</PreferenceScreen>
<com.android.settings.cyanogenmod.CMSystemSettingSwitchPreference
+ android:key="notification_light_multiple_leds_enable"
+ android:title="@string/notification_light_use_multiple_leds"
+ android:dependency="notification_light_pulse" />
+
+ <com.android.settings.cyanogenmod.CMSystemSettingSwitchPreference
android:key="notification_light_screen_on_enable"
android:title="@string/notification_light_screen_on"
android:dependency="notification_light_pulse" />
diff --git a/src/com/android/settings/notificationlight/NotificationLightSettings.java b/src/com/android/settings/notificationlight/NotificationLightSettings.java
index eb0912f..437abcd 100644
--- a/src/com/android/settings/notificationlight/NotificationLightSettings.java
+++ b/src/com/android/settings/notificationlight/NotificationLightSettings.java
@@ -77,6 +77,7 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
private PreferenceScreen mNotificationLedBrightnessPref;
private SystemSettingSwitchPreference mEnabledPref;
private CMSystemSettingSwitchPreference mCustomEnabledPref;
+ private CMSystemSettingSwitchPreference mMultipleLedsEnabledPref;
private CMSystemSettingSwitchPreference mScreenOnLightsPref;
private ApplicationLightPreference mDefaultPref;
private ApplicationLightPreference mCallPref;
@@ -125,6 +126,8 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
// Advanced light settings
mNotificationLedBrightnessPref = (PreferenceScreen)
findPreference(CMSettings.System.NOTIFICATION_LIGHT_BRIGHTNESS_LEVEL);
+ mMultipleLedsEnabledPref = (CMSystemSettingSwitchPreference)
+ findPreference(CMSettings.System.NOTIFICATION_LIGHT_MULTIPLE_LEDS_ENABLE);
mScreenOnLightsPref = (CMSystemSettingSwitchPreference)
findPreference(CMSettings.System.NOTIFICATION_LIGHT_SCREEN_ON);
mScreenOnLightsPref.setOnPreferenceChangeListener(this);
@@ -136,6 +139,12 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
} else {
mNotificationLedBrightnessPref.setOnPreferenceChangeListener(this);
}
+ if (!resources.getBoolean(
+ org.cyanogenmod.platform.internal.R.bool.config_multipleNotificationLeds)) {
+ mAdvancedPrefs.removePreference(mMultipleLedsEnabledPref);
+ } else {
+ mMultipleLedsEnabledPref.setOnPreferenceChangeListener(this);
+ }
// Missed call and Voicemail preferences should only show on devices with a voice capabilities
TelephonyManager tm = (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE);
@@ -424,6 +433,7 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mEnabledPref || preference == mCustomEnabledPref ||
+ preference == mMultipleLedsEnabledPref ||
preference == mNotificationLedBrightnessPref ||
preference == mScreenOnLightsPref) {
getActivity().invalidateOptionsMenu();