summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorAlexander Martinz <alex@amartinz.at>2017-08-25 12:01:11 +0200
committeralk3pInjection <webmaster@raspii.tech>2022-05-07 00:20:58 +0800
commitb56b36abbdc4f34a924d106c0b954efb5d52bc3d (patch)
tree2548e0edd918a4836f06876ae165c9010d5045a8 /core
parentb22a41ebeb8fc9bf9093bf5a713edf2abb47f838 (diff)
BatteryService: Add support for OEM fast charger detection
Allows to indicate, whether a device is charged using a proprietary OEM fast charge solution, which write their status to sysfs. The OEM fast charge detection tries to be as generic as possible and is configured via overlays. Path to sysfs to read status - core/res/res/values/custom_config.xml - config_oemFastChargerStatusPath Value expected from read status (Defaults to "1" if not specified) - core/res/res/values/custom_config.xml - config_oemFastChargerStatusValue Change-Id: I6f3598a5a6a3efc76553261d2cf73094170d4110 Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/java/android/os/BatteryManager.java7
-rw-r--r--core/res/res/values/ice_config.xml6
-rw-r--r--core/res/res/values/ice_symbols.xml6
3 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/os/BatteryManager.java b/core/java/android/os/BatteryManager.java
index 6d4593a2ce87..9702104321b5 100644
--- a/core/java/android/os/BatteryManager.java
+++ b/core/java/android/os/BatteryManager.java
@@ -163,6 +163,13 @@ public class BatteryManager {
@SystemApi
public static final String EXTRA_EVENT_TIMESTAMP = "android.os.extra.EVENT_TIMESTAMP";
+ /**
+ * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}:
+ * boolean value to indicate OEM fast charging
+ * {@hide}
+ */
+ public static final String EXTRA_OEM_FAST_CHARGER = "oem_fast_charger";
+
// values for "status" field in the ACTION_BATTERY_CHANGED Intent
public static final int BATTERY_STATUS_UNKNOWN = Constants.BATTERY_STATUS_UNKNOWN;
public static final int BATTERY_STATUS_CHARGING = Constants.BATTERY_STATUS_CHARGING;
diff --git a/core/res/res/values/ice_config.xml b/core/res/res/values/ice_config.xml
index ee314977e8d9..ecf14aeb4fa3 100644
--- a/core/res/res/values/ice_config.xml
+++ b/core/res/res/values/ice_config.xml
@@ -39,4 +39,10 @@
<!-- Names of the key handler classes -->
<string-array name="config_deviceKeyHandlerClasses" translatable="false">
</string-array>
+
+ <!-- Path to fast charging status file to detect whether an oem fast charger is active -->
+ <string name="config_oemFastChargerStatusPath" translatable="false"></string>
+
+ <!-- Expected value from fast charging status file -->
+ <string name="config_oemFastChargerStatusValue" translatable="false">1</string>
</resources>
diff --git a/core/res/res/values/ice_symbols.xml b/core/res/res/values/ice_symbols.xml
index 8c5a79decaaa..4a17132148c1 100644
--- a/core/res/res/values/ice_symbols.xml
+++ b/core/res/res/values/ice_symbols.xml
@@ -25,4 +25,10 @@
<!-- Device keyhandlers -->
<java-symbol type="array" name="config_deviceKeyHandlerLibs" />
<java-symbol type="array" name="config_deviceKeyHandlerClasses" />
+
+ <!-- Path to fast charging status file to detect whether an oem fast charger is active -->
+ <java-symbol type="string" name="config_oemFastChargerStatusPath" />
+
+ <!-- Expected value from fast charging status file -->
+ <java-symbol type="string" name="config_oemFastChargerStatusValue" />
</resources>