summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/notificationlight
diff options
context:
space:
mode:
authorGabriele M <moto.falcon.git@gmail.com>2015-08-19 16:26:03 +0200
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-12-07 12:47:53 -0800
commit8331303f193ebd05201af8f91c051953ea8d9bf4 (patch)
tree9816c7ef8a0e1a87b8dc36fa0167e0f8581ac286 /src/com/android/settings/notificationlight
parent050c08bdd34e4930b05bec4e084235f746171a68 (diff)
downloadpackages_apps_Settings-8331303f193ebd05201af8f91c051953ea8d9bf4.zip
packages_apps_Settings-8331303f193ebd05201af8f91c051953ea8d9bf4.tar.gz
packages_apps_Settings-8331303f193ebd05201af8f91c051953ea8d9bf4.tar.bz2
Settings: Always enable the per-app pulse light settings
All the per-app light settings, including the pulse light settings, were made dependent on config_multiColorNotificationLed. The code to enable the notification color settings depending on the value of config_multiColorNotificationLed is already in place, so enable the advanced light settings unconditionally. Change-Id: Ie396f5e6e190c6d3f08c83dd0b38b038f0653b85
Diffstat (limited to 'src/com/android/settings/notificationlight')
-rw-r--r--src/com/android/settings/notificationlight/NotificationLightSettings.java33
1 files changed, 6 insertions, 27 deletions
diff --git a/src/com/android/settings/notificationlight/NotificationLightSettings.java b/src/com/android/settings/notificationlight/NotificationLightSettings.java
index 437abcd..d70977f 100644
--- a/src/com/android/settings/notificationlight/NotificationLightSettings.java
+++ b/src/com/android/settings/notificationlight/NotificationLightSettings.java
@@ -67,8 +67,6 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
private static final int MENU_ADD = 0;
private static final int DIALOG_APPS = 0;
- private boolean mAdjustableNotificationLedBrightness;
- private boolean mMultiColorNotificationLed;
private int mDefaultColor;
private int mDefaultLedOn;
private int mDefaultLedOff;
@@ -95,14 +93,7 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
PreferenceScreen prefSet = getPreferenceScreen();
Resources resources = getResources();
- PreferenceGroup mGeneralPrefs = (PreferenceGroup) prefSet.findPreference("general_section");
PreferenceGroup mAdvancedPrefs = (PreferenceGroup) prefSet.findPreference("advanced_section");
- PreferenceGroup mPhonePrefs = (PreferenceGroup) prefSet.findPreference("phone_list");
-
- mAdjustableNotificationLedBrightness = resources.getBoolean(
- org.cyanogenmod.platform.internal.R.bool.config_adjustableNotificationLedBrightness);
- mMultiColorNotificationLed = resources.getBoolean(
- com.android.internal.R.bool.config_multiColorNotificationLed);
// Get the system defined default notification color
mDefaultColor = resources.getColor(com.android.internal.R.color.config_defaultNotificationColor);
@@ -134,7 +125,8 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
mCustomEnabledPref = (CMSystemSettingSwitchPreference)
findPreference(CMSettings.System.NOTIFICATION_LIGHT_PULSE_CUSTOM_ENABLE);
mCustomEnabledPref.setOnPreferenceChangeListener(this);
- if (!mAdjustableNotificationLedBrightness) {
+ if (!resources.getBoolean(
+ org.cyanogenmod.platform.internal.R.bool.config_adjustableNotificationLedBrightness)) {
mAdvancedPrefs.removePreference(mNotificationLedBrightnessPref);
} else {
mNotificationLedBrightnessPref.setOnPreferenceChangeListener(this);
@@ -166,13 +158,9 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
mPackageAdapter = new PackageListAdapter(getActivity());
mPackages = new HashMap<String, Package>();
+ setHasOptionsMenu(true);
- if (mMultiColorNotificationLed) {
- setHasOptionsMenu(true);
- } else {
- mAdvancedPrefs.removePreference(mCustomEnabledPref);
- prefSet.removePreference(mPhonePrefs);
- prefSet.removePreference(mApplicationPrefList);
+ if (!resources.getBoolean(com.android.internal.R.bool.config_multiColorNotificationLed)) {
resetColors();
}
}
@@ -254,10 +242,8 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
mVoicemailPref.setAllValues(vmailColor, vmailTimeOn, vmailTimeOff);
}
- if (mMultiColorNotificationLed) {
- mApplicationPrefList = (PreferenceGroup) findPreference("applications_list");
- mApplicationPrefList.setOrderingAsAdded(false);
- }
+ mApplicationPrefList = (PreferenceGroup) findPreference("applications_list");
+ mApplicationPrefList.setOrderingAsAdded(false);
}
private void refreshCustomApplicationPrefs() {
@@ -398,13 +384,6 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
CMSettings.System.putInt(resolver, CMSettings.System.NOTIFICATION_LIGHT_PULSE_CALL_COLOR, mDefaultColor);
CMSettings.System.putInt(resolver, CMSettings.System.NOTIFICATION_LIGHT_PULSE_VMAIL_COLOR, mDefaultColor);
- // Reset to the framework default custom pulse length & speed
- CMSettings.System.putInt(resolver, CMSettings.System.NOTIFICATION_LIGHT_PULSE_CALL_LED_ON, mDefaultLedOn);
- CMSettings.System.putInt(resolver, CMSettings.System.NOTIFICATION_LIGHT_PULSE_CALL_LED_OFF, mDefaultLedOff);
-
- CMSettings.System.putInt(resolver, CMSettings.System.NOTIFICATION_LIGHT_PULSE_VMAIL_LED_ON, mDefaultLedOn);
- CMSettings.System.putInt(resolver, CMSettings.System.NOTIFICATION_LIGHT_PULSE_VMAIL_LED_OFF, mDefaultLedOff);
-
refreshDefault();
}