diff --git a/rootdir/etc/init.universal7904.rc b/rootdir/etc/init.universal7904.rc index bed9cc0..78caabb 100644 --- a/rootdir/etc/init.universal7904.rc +++ b/rootdir/etc/init.universal7904.rc @@ -2,6 +2,9 @@ on init # Disable vendor overlay mount none /vendor/lost+found /vendor/overlay bind + # Fastcharge + chown system radio /sys/class/sec/switch/afc_disable + # ZRAM parameters write /proc/sys/vm/page-cluster 0 write /proc/sys/vm/swappiness 100 diff --git a/sepolicy/private/file.te b/sepolicy/private/file.te index 1b7b650..308be85 100644 --- a/sepolicy/private/file.te +++ b/sepolicy/private/file.te @@ -1,2 +1,3 @@ type sysfs_battery, sysfs_type, fs_type; type sysfs_sec_tsp, fs_type, sysfs_type; +type sysfs_sec_switch, fs_type, sysfs_type; diff --git a/sepolicy/private/file_contexts b/sepolicy/private/file_contexts index 58b877f..2a084aa 100644 --- a/sepolicy/private/file_contexts +++ b/sepolicy/private/file_contexts @@ -4,6 +4,7 @@ # HALs /system/bin/hw/lineage\.touch@1\.0-service\.samsung u:object_r:hal_touch_samsung_exec:s0 /system/bin/hw/android\.hardware\.power@1\.0-service\.exynos u:object_r:hal_power_default_exec:s0 +/system/bin/hw/lineage\.fastcharge@1\.0-service\.samsung u:object_r:hal_fastcharge_samsung_exec:s0 # Vendor overlay /(product|system/product)/vendor_overlay/[0-9]+/etc(/.*)? u:object_r:vendor_configs_file:s0 diff --git a/sepolicy/private/genfs_contexts b/sepolicy/private/genfs_contexts index 3862275..d17bd79 100644 --- a/sepolicy/private/genfs_contexts +++ b/sepolicy/private/genfs_contexts @@ -1,3 +1,4 @@ genfscon sysfs /devices/virtual/sec/tsp u:object_r:sysfs_sec_tsp:s0 +genfscon sysfs /devices/virtual/sec/switch u:object_r:sysfs_sec_switch:s0 genfscon sysfs /devices/platform/13840000.i2c/i2c-10/10-003d/s2mu004-charger/power_supply/s2mu004-charger u:object_r:sysfs_battery:s0 genfscon sysfs /devices/platform/13830000.i2c/i2c-9/9-003b/power_supply/s2mu004-fuelgauge u:object_r:sysfs_battery:s0 diff --git a/sepolicy/private/hal_fastcharge_samsung.te b/sepolicy/private/hal_fastcharge_samsung.te new file mode 100644 index 0000000..e7895e9 --- /dev/null +++ b/sepolicy/private/hal_fastcharge_samsung.te @@ -0,0 +1,10 @@ +type hal_fastcharge_samsung, domain, coredomain; +hal_server_domain(hal_fastcharge_samsung, hal_lineage_fastcharge) + +type hal_fastcharge_samsung_exec, exec_type, system_file_type, file_type; +init_daemon_domain(hal_fastcharge_samsung) + +allow hal_fastcharge_samsung sysfs_sec_switch:dir search; +allow hal_fastcharge_samsung sysfs_sec_switch:file rw_file_perms; + +set_prop(hal_fastcharge_samsung, sec_fastcharge_prop) diff --git a/sepolicy/private/property.te b/sepolicy/private/property.te new file mode 100644 index 0000000..d32ae8b --- /dev/null +++ b/sepolicy/private/property.te @@ -0,0 +1 @@ +type sec_fastcharge_prop, property_type; diff --git a/sepolicy/private/property_contexts b/sepolicy/private/property_contexts new file mode 100644 index 0000000..b3e60c0 --- /dev/null +++ b/sepolicy/private/property_contexts @@ -0,0 +1 @@ +persist.vendor.sec.fastchg_enabled u:object_r:sec_fastcharge_prop:s0 diff --git a/universal7904-common.mk b/universal7904-common.mk index 1bf3f22..ded8099 100644 --- a/universal7904-common.mk +++ b/universal7904-common.mk @@ -17,6 +17,10 @@ PRODUCT_PACKAGES += \ TARGET_SCREEN_HEIGHT := 2340 TARGET_SCREEN_WIDTH := 1080 +# FastCharge +PRODUCT_PACKAGES += \ + lineage.fastcharge@1.0-service.samsung + # Init PRODUCT_PACKAGES += \ init.universal7904.rc \