diff options
author | AdrianDC <radian.dc@gmail.com> | 2015-11-12 14:01:58 +0100 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-11-16 11:52:08 -0800 |
commit | eeef647fe68714d843bf2bb7c39251c89f62f172 (patch) | |
tree | b98f61b2a374ea5b230c5e78ff86fa2eb28f4d15 | |
parent | e0eac298ca46ee5fef7dca5d6d126c8cb4b5ac42 (diff) | |
download | packages_apps_Settings-eeef647fe68714d843bf2bb7c39251c89f62f172.zip packages_apps_Settings-eeef647fe68714d843bf2bb7c39251c89f62f172.tar.gz packages_apps_Settings-eeef647fe68714d843bf2bb7c39251c89f62f172.tar.bz2 |
Multiple LEDs [2/3]: Illumination Bars support
Implement the support of a multiple LEDs settings.
The setting is deactivated by default
and will be ignored by the unimplemented phones.
Current LibLights will simply not use the new variable.
Changes includes :
frameworks/base
hardware/libhardware
packages/apps/Settings
Change-Id: I5531093cd0543d7730a8c3f83c0aebb3678436d5
Signed-off-by: AdrianDC <radian.dc@gmail.com>
-rw-r--r-- | res/values/cm_strings.xml | 1 | ||||
-rw-r--r-- | res/xml/notification_light_settings.xml | 5 | ||||
-rw-r--r-- | src/com/android/settings/notificationlight/NotificationLightSettings.java | 10 |
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(); |