diff options
| author | LuK1337 <priv.luk@gmail.com> | 2018-12-14 12:51:17 +0100 |
|---|---|---|
| committer | LuK1337 <priv.luk@gmail.com> | 2018-12-14 13:11:24 +0100 |
| commit | 1f78680c7734bc8c3229115f98c36471d25b98dd (patch) | |
| tree | 0782f2be0528489027632cc9afc3adbc9dd01518 | |
| parent | a6869b716c3c2693ead93a01c61d280c1a84a528 (diff) | |
kirin970-common: Fix offline charging
* Load /vendor/etc/init/charger/init.charger.rc when bootmode
is set to init (originally hardcoded in /init binary @ EMUI).
* Ship /sbin/charger from EMUI so that we can actually see something
on the screen.
* Address EMUI charger denials.
| -rw-r--r-- | proprietary-files.txt | 1 | ||||
| -rw-r--r-- | rootdir/etc/init.kirin970.rc | 9 | ||||
| -rw-r--r-- | sepolicy/private/charger.te | 8 | ||||
| -rw-r--r-- | sepolicy/public/attributes | 2 |
4 files changed, 20 insertions, 0 deletions
diff --git a/proprietary-files.txt b/proprietary-files.txt index 118c01b..72923ba 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -1917,6 +1917,7 @@ etc/charger/public/800_serial/scp_charging_20.png etc/charger/public/800_serial/scp_charging_21.png etc/charger/public/800_serial/scp_charging_22.png etc/charger/public/800_serial/scp_charging_23.png +-sbin/charger:sbin/chargeonlymode;rootfs|124a478904a2bd08e2a1e6c4a1bdc4ab124743d4 # Display engine bin/displayengineserver diff --git a/rootdir/etc/init.kirin970.rc b/rootdir/etc/init.kirin970.rc index a4b7c17..e8f1cca 100644 --- a/rootdir/etc/init.kirin970.rc +++ b/rootdir/etc/init.kirin970.rc @@ -1,3 +1,5 @@ +import /vendor/etc/init/${ro.bootmode}/init.${ro.bootmode}.rc + on init mkdir /dev/block/bootdevice symlink /dev/block/by-name /dev/block/bootdevice/by-name @@ -29,3 +31,10 @@ service bfm-ctl /system/bin/bfm-ctl user system group system oneshot + +service charger /sbin/chargeonlymode -p + class charger + user root + group root system + critical + seclabel u:r:charger:s0 diff --git a/sepolicy/private/charger.te b/sepolicy/private/charger.te new file mode 100644 index 0000000..9b966c8 --- /dev/null +++ b/sepolicy/private/charger.te @@ -0,0 +1,8 @@ +# Allow charger to write to sysfs_backlight_attr +allow charger sysfs_backlight_attr:file w_file_perms; + +# Allow charger to write to sysfs_led_attr +allow charger sysfs_led_attr:file w_file_perms; + +# Allow charger to read and write to sysfs_power +allow charger sysfs_power:file rw_file_perms; diff --git a/sepolicy/public/attributes b/sepolicy/public/attributes new file mode 100644 index 0000000..86ff489 --- /dev/null +++ b/sepolicy/public/attributes @@ -0,0 +1,2 @@ +attribute sysfs_backlight_attr; +attribute sysfs_led_attr; |
