From 50fc22b8a1efea977e17c3456dcb3454a53e0c53 Mon Sep 17 00:00:00 2001 From: Adnan Begovic Date: Mon, 9 Nov 2015 16:24:29 -0800 Subject: [PATCH] cmsdk: Move battery light settings to CMSettings. Change-Id: I11a80bdeab369f851017c516039adc6400572b09 --- .../cmsettings/CMSettingsProvider.java | 42 +++++++++++++++++++ .../cyanogenmod/providers/CMSettings.java | 32 ++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java index 9dca2520..4906a752 100644 --- a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java +++ b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java @@ -450,6 +450,38 @@ public class CMSettingsProvider extends ContentProvider { */ public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; + + /** + * Whether the battery light should be enabled (if hardware supports it) + * The value is boolean (1 or 0). + * @hide + */ + public static final String BATTERY_LIGHT_ENABLED = "battery_light_enabled"; + + /** + * Whether the battery LED should repeatedly flash when the battery is low + * on charge. The value is boolean (1 or 0). + * @hide + */ + public static final String BATTERY_LIGHT_PULSE = "battery_light_pulse"; + + /** + * What color to use for the battery LED while charging - low + * @hide + */ + public static final String BATTERY_LIGHT_LOW_COLOR = "battery_light_low_color"; + + /** + * What color to use for the battery LED while charging - medium + * @hide + */ + public static final String BATTERY_LIGHT_MEDIUM_COLOR = "battery_light_medium_color"; + + /** + * What color to use for the battery LED while charging - full + * @hide + */ + public static final String BATTERY_LIGHT_FULL_COLOR = "battery_light_full_color"; } /** @@ -502,6 +534,16 @@ public class CMSettingsProvider extends ContentProvider { CMSettings.System.CAMERA_LAUNCH); systemToCmSettingsMap.put(LegacyCMSettings.SWAP_VOLUME_KEYS_ON_ROTATION, CMSettings.System.SWAP_VOLUME_KEYS_ON_ROTATION); + systemToCmSettingsMap.put(LegacyCMSettings.BATTERY_LIGHT_ENABLED, + CMSettings.System.BATTERY_LIGHT_ENABLED); + systemToCmSettingsMap.put(LegacyCMSettings.BATTERY_LIGHT_PULSE, + CMSettings.System.BATTERY_LIGHT_PULSE); + systemToCmSettingsMap.put(LegacyCMSettings.BATTERY_LIGHT_LOW_COLOR, + CMSettings.System.BATTERY_LIGHT_LOW_COLOR); + systemToCmSettingsMap.put(LegacyCMSettings.BATTERY_LIGHT_MEDIUM_COLOR, + CMSettings.System.BATTERY_LIGHT_MEDIUM_COLOR); + systemToCmSettingsMap.put(LegacyCMSettings.BATTERY_LIGHT_FULL_COLOR, + CMSettings.System.BATTERY_LIGHT_FULL_COLOR); int rowsMigrated = migrateCMSettingsForTable(userId, CMDatabaseHelper.CMTableNames.TABLE_SYSTEM, systemToCmSettingsMap); diff --git a/src/java/cyanogenmod/providers/CMSettings.java b/src/java/cyanogenmod/providers/CMSettings.java index d0c96fae..0d0419fa 100644 --- a/src/java/cyanogenmod/providers/CMSettings.java +++ b/src/java/cyanogenmod/providers/CMSettings.java @@ -869,6 +869,38 @@ public final class CMSettings { * @hide */ public static final String SWAP_VOLUME_KEYS_ON_ROTATION = "swap_volume_keys_on_rotation"; + + /** + * Whether the battery light should be enabled (if hardware supports it) + * The value is boolean (1 or 0). + * @hide + */ + public static final String BATTERY_LIGHT_ENABLED = "battery_light_enabled"; + + /** + * Whether the battery LED should repeatedly flash when the battery is low + * on charge. The value is boolean (1 or 0). + * @hide + */ + public static final String BATTERY_LIGHT_PULSE = "battery_light_pulse"; + + /** + * What color to use for the battery LED while charging - low + * @hide + */ + public static final String BATTERY_LIGHT_LOW_COLOR = "battery_light_low_color"; + + /** + * What color to use for the battery LED while charging - medium + * @hide + */ + public static final String BATTERY_LIGHT_MEDIUM_COLOR = "battery_light_medium_color"; + + /** + * What color to use for the battery LED while charging - full + * @hide + */ + public static final String BATTERY_LIGHT_FULL_COLOR = "battery_light_full_color"; } /**