sdk: Implement Lineage health service
Change-Id: I772ccf6d323c24d681aa8468bf4318c7b73bd3f5
diff --git a/res/values/config.xml b/res/values/config.xml
index f1e549f..0bb0d55 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -24,8 +24,38 @@
<!-- Defines external services to be started by the OmniRomSystemServer at boot. The service itself
should publish as a binder services in its onStart -->
<string-array name="config_externalOmniRomServices">
+ <item>org.omnirom.omnilib.internal.health.HealthInterfaceService</item>
</string-array>
<!-- The LineageSystemServer class that is invoked from Android's SystemServer -->
<string name="config_externalSystemServer" translatable="false">org.omnirom.omnilib.internal.OmniRomSystemServer</string>
+
+ <!-- Whether charging control should be enabled by default -->
+ <bool name="config_chargingControlEnabled">false</bool>
+ <!-- Default charging control mode.
+ This integer should be set to:
+ 1 - auto - Use the alarm to calculate the time range when to activate charging control
+ 2 - custom - Use time range when the device is usually charging for hours
+ 3 - limit - Just limit charging -->
+ <integer name="config_defaultChargingControlMode">1</integer>
+ <!-- Default time when charging control is activated.
+ Represented as seconds from midnight (e.g. 79200 == 10pm). -->
+ <integer name="config_defaultChargingControlStartTime">79200</integer>
+ <!-- Default time when battery will be fully charged.
+ Represented as seconds from midnight (e.g. 21600 == 6am). -->
+ <integer name="config_defaultChargingControlTargetTime">21600</integer>
+ <!-- Default charging limit. -->
+ <integer name="config_defaultChargingControlLimit">80</integer>
+ <!-- Considering the fact that the system might have an incorrect estimation of the time to
+ full. Set a time margin to make the device fully charged before the target time arrives.
+ The unit is minutes and the default value is 30 minutes. If you find that it is not enough
+ to make the device to be fully charged at the target time, increase the value
+ -->
+ <integer name="config_chargingControlTimeMargin">30</integer>
+ <!-- For a device that cannot bypass battery when charging stops (that is, the battery current
+ is 0mA when charging stops), the battery will gradually discharge. So we need to make it
+ recharge when the battery level is lower than a threshold. Set this so that the device
+ will be charged between (limit - val) and limit. -->
+ <integer name="config_chargingControlBatteryRechargeMargin">10</integer>
+
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6fe9232..b0c80c7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -36,4 +36,13 @@
<!-- advanced reboot to fastboot. -->
<string name="reboot_to_fastboot_title">Reboot fastboot</string>
<string name="reboot_to_fastboot_message">Rebooting to fastboot\u2026</string>
+
+ <!-- Health interface -->
+ <string name="charging_control_notification_channel">Charging control</string>
+ <string name="charging_control_notification_title">Charging control</string>
+ <string name="charging_control_notification_cancel_once">Cancel</string>
+ <string name="charging_control_notification_content_limit">Battery will be charged to %1$d%%</string>
+ <string name="charging_control_notification_content_limit_reached">Battery is charged to %1$d%%</string>
+ <string name="charging_control_notification_content_target">Battery will be fully charged at %1$s</string>
+ <string name="charging_control_notification_content_target_reached">Battery is charged</string>
</resources>
diff --git a/res/values/symbols.xml b/res/values/symbols.xml
index 00e8cc7..201401d 100644
--- a/res/values/symbols.xml
+++ b/res/values/symbols.xml
@@ -50,4 +50,21 @@
<!-- OmniRom system server -->
<java-symbol type="string" name="config_externalSystemServer" />
+ <!-- Health interface -->
+ <java-symbol type="bool" name="config_chargingControlEnabled" />
+ <java-symbol type="integer" name="config_defaultChargingControlMode" />
+ <java-symbol type="integer" name="config_defaultChargingControlStartTime" />
+ <java-symbol type="integer" name="config_defaultChargingControlTargetTime" />
+ <java-symbol type="integer" name="config_defaultChargingControlLimit" />
+ <java-symbol type="drawable" name="ic_charging_control" />
+ <java-symbol type="integer" name="config_chargingControlTimeMargin" />
+ <java-symbol type="integer" name="config_chargingControlBatteryRechargeMargin" />
+ <java-symbol type="string" name="charging_control_notification_channel" />
+ <java-symbol type="string" name="charging_control_notification_title" />
+ <java-symbol type="string" name="charging_control_notification_cancel_once" />
+ <java-symbol type="string" name="charging_control_notification_content_limit" />
+ <java-symbol type="string" name="charging_control_notification_content_limit_reached" />
+ <java-symbol type="string" name="charging_control_notification_content_target" />
+ <java-symbol type="string" name="charging_control_notification_content_target_reached" />
+
</resources>