OmniLib: Add Battery Led Customization feature
Change-Id: I0446d670e977a348c9d6ca5d61b3380e072d83e2
diff --git a/res/values/config.xml b/res/values/config.xml
index dac1acf..496982d 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -10,4 +10,14 @@
<!-- make sure you enable this only if your device supports deep slepp
with active proximity sensor event listener -->
<bool name="config_proxiSensorWakupCheck">false</bool>
+
+ <!-- Is the battery LED intrusive? Used to decide if there should be a disable option -->
+ <bool name="config_intrusiveBatteryLed">false</bool>
+ <!-- Does the battery LED support multiple colors?
+ Used to decide if the user can change the colors -->
+ <bool name="config_multiColorBatteryLed">false</bool>
+ <!-- Does the device supports fast charging -->
+ <bool name="config_FastChargingLedSupported">false</bool>
+ <!-- Default value for led color when fast charging is active -->
+ <integer name="config_notificationsFastBatteryARGB">0x0000FF</integer>
</resources>
diff --git a/res/values/symbols.xml b/res/values/symbols.xml
index 6b72c94..3537b6d 100644
--- a/res/values/symbols.xml
+++ b/res/values/symbols.xml
@@ -20,6 +20,12 @@
<java-symbol type="anim" name="last_app_in" />
<java-symbol type="anim" name="last_app_out" />
+ <!-- Battery Led -->
+ <java-symbol type="bool" name="config_intrusiveBatteryLed" />
+ <java-symbol type="bool" name="config_multiColorBatteryLed" />
+ <java-symbol type="bool" name="config_FastChargingLedSupported" />
+ <java-symbol type="integer" name="config_notificationsFastBatteryARGB" />
+
<!-- Device features Support-->
<java-symbol type="bool" name="config_enableAutoSuspend" />
<java-symbol type="bool" name="config_proxiSensorWakupCheck" />
diff --git a/src/org/omnirom/omnilib/utils/OmniSettings.java b/src/org/omnirom/omnilib/utils/OmniSettings.java
index 156adb7..baacaec 100644
--- a/src/org/omnirom/omnilib/utils/OmniSettings.java
+++ b/src/org/omnirom/omnilib/utils/OmniSettings.java
@@ -115,6 +115,71 @@
*/
public static final String OMNI_GESTURE_HANDLE_SMALL = "navbar_gesture_handle_small";
+ /**
+ * Whether the battery light should be enabled (if hardware supports it)
+ * The value is boolean (1 or 0).
+ * @hide
+ */
+ public static final String OMNI_BATTERY_LIGHT_ENABLED = "battery_light_enabled";
+
+ /**
+ * Whether to show battery light when DND mode is active
+ * @hide
+ */
+ public static final String OMNI_BATTERY_LIGHT_ALLOW_ON_DND = "battery_light_allow_on_dnd";
+
+ /**
+ * Whether to show blinking light when battery is low
+ * @hide
+ */
+ public static final String OMNI_BATTERY_LIGHT_LOW_BLINKING = "battery_light_low_blinking";
+
+ /**
+ * Low battery charging color
+ * @hide
+ */
+ public static final String OMNI_BATTERY_LIGHT_LOW_COLOR = "battery_light_low_color";
+
+ /**
+ * Medium battery charging color
+ * @hide
+ */
+ public static final String OMNI_BATTERY_LIGHT_MEDIUM_COLOR = "battery_light_medium_color";
+
+ /**
+ * Full battery charging color
+ * @hide
+ */
+ public static final String OMNI_BATTERY_LIGHT_FULL_COLOR = "battery_light_full_color";
+
+ /**
+ * Really full 100 battery charging color
+ * @hide
+ */
+ public static final String OMNI_BATTERY_LIGHT_REALLY_FULL_COLOR =
+ "battery_light_really_full_color";
+
+ /**
+ * Whether the battery light should only be enabled on fully charged battery.
+ * The value is boolean (1 or 0).
+ * @hide
+ */
+ public static final String OMNI_BATTERY_LIGHT_ONLY_FULLY_CHARGED =
+ "battery_light_only_fully_charged";
+
+ /**
+ * What color to use for the battery LED while charging - low
+ * @hide
+ */
+ public static final String OMNI_FAST_BATTERY_LIGHT_COLOR = "fast_battery_light_color";
+
+ /**
+ * Whether the fast charging battery light is enabled
+ * The value is boolean (1 or 0).
+ * @hide
+ */
+ public static final String OMNI_FAST_CHARGING_LED_ENABLED = "fast_charging_led_enabled";
+
/**
* SettingsBackupAgent will combine its list with this so we dont need
* to add new things into SettingsProvider SystemSettings
@@ -137,6 +202,14 @@
OMNI_NAVIGATION_BAR_ARROW_KEYS,
OMNI_GESTURE_HANDLE_HIDE,
OMNI_GESTURE_HANDLE_SMALL,
+ OMNI_BATTERY_LIGHT_ENABLED,
+ OMNI_BATTERY_LIGHT_ALLOW_ON_DND,
+ OMNI_BATTERY_LIGHT_LOW_BLINKING,
+ OMNI_BATTERY_LIGHT_LOW_COLOR,
+ OMNI_BATTERY_LIGHT_MEDIUM_COLOR,
+ OMNI_BATTERY_LIGHT_FULL_COLOR,
+ OMNI_BATTERY_LIGHT_REALLY_FULL_COLOR,
+ OMNI_BATTERY_LIGHT_ONLY_FULLY_CHARGED,
};
/**
@@ -166,5 +239,15 @@
OMNI_SETTINGS_VALIDATORS.put(OMNI_NAVIGATION_BAR_ARROW_KEYS, 0);
OMNI_SETTINGS_VALIDATORS.put(OMNI_GESTURE_HANDLE_HIDE, 0);
OMNI_SETTINGS_VALIDATORS.put(OMNI_GESTURE_HANDLE_SMALL, 0);
+ OMNI_SETTINGS_VALIDATORS.put(OMNI_BATTERY_LIGHT_ENABLED, 0);
+ OMNI_SETTINGS_VALIDATORS.put(OMNI_BATTERY_LIGHT_ALLOW_ON_DND, 0);
+ OMNI_SETTINGS_VALIDATORS.put(OMNI_BATTERY_LIGHT_LOW_BLINKING, 0);
+ OMNI_SETTINGS_VALIDATORS.put(OMNI_BATTERY_LIGHT_LOW_COLOR, 1);
+ OMNI_SETTINGS_VALIDATORS.put(OMNI_BATTERY_LIGHT_MEDIUM_COLOR, 1);
+ OMNI_SETTINGS_VALIDATORS.put(OMNI_BATTERY_LIGHT_FULL_COLOR, 1);
+ OMNI_SETTINGS_VALIDATORS.put(OMNI_BATTERY_LIGHT_REALLY_FULL_COLOR, 1);
+ OMNI_SETTINGS_VALIDATORS.put(OMNI_FAST_BATTERY_LIGHT_COLOR, 1);
+ OMNI_SETTINGS_VALIDATORS.put(OMNI_FAST_CHARGING_LED_ENABLED, 0);
+ OMNI_SETTINGS_VALIDATORS.put(OMNI_BATTERY_LIGHT_ONLY_FULLY_CHARGED, 0);
}
}