summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-11-09 16:24:03 -0800
committerAdnan Begovic <adnan@cyngn.com>2015-11-09 16:24:03 -0800
commit37994dedd8f748a724ea33f5d25c28a4f31d12b5 (patch)
tree5bf71ffa52cda291be8c511ce9558e5cd4ad545f
parente128feede5d5760fb8f4cd46ba5eb2d5a1052e18 (diff)
downloadpackages_apps_Settings-37994dedd8f748a724ea33f5d25c28a4f31d12b5.zip
packages_apps_Settings-37994dedd8f748a724ea33f5d25c28a4f31d12b5.tar.gz
packages_apps_Settings-37994dedd8f748a724ea33f5d25c28a4f31d12b5.tar.bz2
Settings: Move battery light settings to CMSettings.
Change-Id: I2299aea6067507a9ab7d11a1a64ca99479efc5af
-rw-r--r--res/xml/battery_light_settings.xml4
-rw-r--r--src/com/android/settings/notificationlight/BatteryLightSettings.java19
2 files changed, 12 insertions, 11 deletions
diff --git a/res/xml/battery_light_settings.xml b/res/xml/battery_light_settings.xml
index d7e8c0b..9b505f5 100644
--- a/res/xml/battery_light_settings.xml
+++ b/res/xml/battery_light_settings.xml
@@ -21,12 +21,12 @@
android:key="general_section"
android:title="@string/notification_light_general_title">
- <com.android.settings.cyanogenmod.SystemSettingSwitchPreference
+ <com.android.settings.cyanogenmod.CMSystemSettingSwitchPreference
android:key="battery_light_enabled"
android:title="@string/battery_light_title"
android:defaultValue="true" />
- <com.android.settings.cyanogenmod.SystemSettingSwitchPreference
+ <com.android.settings.cyanogenmod.CMSystemSettingSwitchPreference
android:key="battery_light_pulse"
android:title="@string/battery_low_pulse_title"
android:defaultValue="true"
diff --git a/src/com/android/settings/notificationlight/BatteryLightSettings.java b/src/com/android/settings/notificationlight/BatteryLightSettings.java
index 5dd68d8..7a4cf05 100644
--- a/src/com/android/settings/notificationlight/BatteryLightSettings.java
+++ b/src/com/android/settings/notificationlight/BatteryLightSettings.java
@@ -30,6 +30,7 @@ import android.view.MenuItem;
import com.android.internal.logging.MetricsLogger;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
+import cyanogenmod.providers.CMSettings;
public class BatteryLightSettings extends SettingsPreferenceFragment implements
Preference.OnPreferenceChangeListener {
@@ -87,19 +88,19 @@ public class BatteryLightSettings extends SettingsPreferenceFragment implements
Resources res = getResources();
if (mLowColorPref != null) {
- int lowColor = Settings.System.getInt(resolver, Settings.System.BATTERY_LIGHT_LOW_COLOR,
+ int lowColor = CMSettings.System.getInt(resolver, CMSettings.System.BATTERY_LIGHT_LOW_COLOR,
res.getInteger(com.android.internal.R.integer.config_notificationsBatteryLowARGB));
mLowColorPref.setAllValues(lowColor, 0, 0, false);
}
if (mMediumColorPref != null) {
- int mediumColor = Settings.System.getInt(resolver, Settings.System.BATTERY_LIGHT_MEDIUM_COLOR,
+ int mediumColor = CMSettings.System.getInt(resolver, CMSettings.System.BATTERY_LIGHT_MEDIUM_COLOR,
res.getInteger(com.android.internal.R.integer.config_notificationsBatteryMediumARGB));
mMediumColorPref.setAllValues(mediumColor, 0, 0, false);
}
if (mFullColorPref != null) {
- int fullColor = Settings.System.getInt(resolver, Settings.System.BATTERY_LIGHT_FULL_COLOR,
+ int fullColor = CMSettings.System.getInt(resolver, CMSettings.System.BATTERY_LIGHT_FULL_COLOR,
res.getInteger(com.android.internal.R.integer.config_notificationsBatteryFullARGB));
mFullColorPref.setAllValues(fullColor, 0, 0, false);
}
@@ -115,11 +116,11 @@ public class BatteryLightSettings extends SettingsPreferenceFragment implements
ContentResolver resolver = getContentResolver();
if (key.equals(LOW_COLOR_PREF)) {
- Settings.System.putInt(resolver, Settings.System.BATTERY_LIGHT_LOW_COLOR, color);
+ CMSettings.System.putInt(resolver, CMSettings.System.BATTERY_LIGHT_LOW_COLOR, color);
} else if (key.equals(MEDIUM_COLOR_PREF)) {
- Settings.System.putInt(resolver, Settings.System.BATTERY_LIGHT_MEDIUM_COLOR, color);
+ CMSettings.System.putInt(resolver, CMSettings.System.BATTERY_LIGHT_MEDIUM_COLOR, color);
} else if (key.equals(FULL_COLOR_PREF)) {
- Settings.System.putInt(resolver, Settings.System.BATTERY_LIGHT_FULL_COLOR, color);
+ CMSettings.System.putInt(resolver, CMSettings.System.BATTERY_LIGHT_FULL_COLOR, color);
}
}
@@ -146,11 +147,11 @@ public class BatteryLightSettings extends SettingsPreferenceFragment implements
Resources res = getResources();
// Reset to the framework default colors
- Settings.System.putInt(resolver, Settings.System.BATTERY_LIGHT_LOW_COLOR,
+ CMSettings.System.putInt(resolver, CMSettings.System.BATTERY_LIGHT_LOW_COLOR,
res.getInteger(com.android.internal.R.integer.config_notificationsBatteryLowARGB));
- Settings.System.putInt(resolver, Settings.System.BATTERY_LIGHT_MEDIUM_COLOR,
+ CMSettings.System.putInt(resolver, CMSettings.System.BATTERY_LIGHT_MEDIUM_COLOR,
res.getInteger(com.android.internal.R.integer.config_notificationsBatteryMediumARGB));
- Settings.System.putInt(resolver, Settings.System.BATTERY_LIGHT_FULL_COLOR,
+ CMSettings.System.putInt(resolver, CMSettings.System.BATTERY_LIGHT_FULL_COLOR,
res.getInteger(com.android.internal.R.integer.config_notificationsBatteryFullARGB));
refreshDefault();
}