vendor: Smart Charging(4/4)
Change-Id: I51966875aaacc4b0068772ae732abab16652c973
diff --git a/config/common.mk b/config/common.mk
index 9e3e3d4..d1e17ea 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -57,6 +57,7 @@
PRODUCT_COPY_FILES += \
vendor/bliss/prebuilt/common/etc/init/init.bliss-system_ext.rc:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/init/init.bliss-system_ext.rc \
vendor/bliss/prebuilt/common/etc/init/init.bliss-updater.rc:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/init/init.bliss-updater.rc \
+ vendor/bliss/prebuilt/common/etc/init/smartcharge-init.rc:$(TARGET_COPY_OUT_SYSTEM)/etc/init/smartcharge-init.rc \
vendor/bliss/prebuilt/common/etc/init/init.openssh.rc:$(TARGET_COPY_OUT_PRODUCT)/etc/init/init.openssh.rc
# Enable Android Beam on all targets
diff --git a/prebuilt/common/etc/init/smartcharge-init.rc b/prebuilt/common/etc/init/smartcharge-init.rc
index 63c9204..d67252b 100644
--- a/prebuilt/common/etc/init/smartcharge-init.rc
+++ b/prebuilt/common/etc/init/smartcharge-init.rc
@@ -1,2 +1,7 @@
on post-fs-data
+ chown system system /sys/class/power_supply/battery/battery_charging_enabled
+ chmod 0666 /sys/class/power_supply/battery/battery_charging_enabled
+ chown system system /sys/class/power_supply/battery/charging_enabled
+ chmod 0666 /sys/class/power_supply/battery/charging_enabled
chown system system /sys/class/power_supply/battery/input_suspend
+ chmod 0666 /sys/class/power_supply/battery/input_suspend