Enable charger mode

1) device.mk: add charger_res_images to PRODUCT_PACKAGES
to use the default charger mode images
2) init.hardware.rc: configure charger service class
3) BoardConfig.mk: enable suspend in charger mode

Bug: 36046603
Change-Id: I3652a69784b8ecd4e670f26fdd66b7c68d578f9f
Signed-off-by: Yueyao Zhu <yueyao@google.com>
This commit is contained in:
Yueyao Zhu
2017-03-09 18:27:28 -08:00
committed by Thierry Strudel
parent 5a88dfd5db
commit a18de9021d
3 changed files with 20 additions and 0 deletions

View File

@@ -110,3 +110,6 @@ TARGET_USES_HWC2 := true
# Display
TARGET_HAS_WIDE_COLOR_DISPLAY := true
TARGET_HAS_HDR_DISPLAY := false
# Charger Mode
BOARD_CHARGER_ENABLE_SUSPEND := true

View File

@@ -421,3 +421,7 @@ PRODUCT_COPY_FILES += \
# Provide meaningful APN configuration
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/apns-full-conf.xml:system/etc/apns-conf.xml
# Use the default charger mode images
PRODUCT_PACKAGES += \
charger_res_images

View File

@@ -17,6 +17,19 @@
import init.${ro.hardware}.usb.rc
import init.${ro.hardware}.diag.rc
on charger
write /sys/devices/system/cpu/cpu2/online 0
write /sys/devices/system/cpu/cpu3/online 0
write /sys/devices/system/cpu/cpu4/online 0
write /sys/devices/system/cpu/cpu5/online 0
write /sys/devices/system/cpu/cpu6/online 0
write /sys/devices/system/cpu/cpu7/online 0
wait /dev/block/bootdevice
service charger /charger
class charger
seclabel u:r:charger:s0
on early-init
mount debugfs debugfs /sys/kernel/debug
chmod 0755 /sys/kernel/debug