From b510b33fe015b1f4a6c271960101a018bcfe8f12 Mon Sep 17 00:00:00 2001 From: Francescodario Cuzzocrea Date: Thu, 24 Dec 2020 16:18:14 +0100 Subject: [PATCH] sm7125: Build fastcharge HIDL Change-Id: Iec1a7faec24f0d5b4b1d2f1ef52b781368c5bd51 --- common.mk | 4 ++++ configs/framework_compatibility_matrix.xml | 8 ++++++++ rootdir/etc/init.samsung.rc | 2 ++ sepolicy/vendor/file.te | 2 ++ sepolicy/vendor/file_contexts | 4 ++++ sepolicy/vendor/hal_lineage_fastcharge_default.te | 4 ++++ sepolicy/vendor/property.te | 1 + sepolicy/vendor/property_contexts | 3 +++ 8 files changed, 28 insertions(+) create mode 100644 sepolicy/vendor/hal_lineage_fastcharge_default.te create mode 100644 sepolicy/vendor/property.te diff --git a/common.mk b/common.mk index 1acc768..e518201 100644 --- a/common.mk +++ b/common.mk @@ -150,6 +150,10 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ fastbootd +# FastCharge +PRODUCT_PACKAGES += \ + vendor.lineage.fastcharge@1.0-service.samsung + # FM PRODUCT_PACKAGES += \ FM2 \ diff --git a/configs/framework_compatibility_matrix.xml b/configs/framework_compatibility_matrix.xml index 3a3cdbb..72ed22c 100644 --- a/configs/framework_compatibility_matrix.xml +++ b/configs/framework_compatibility_matrix.xml @@ -167,6 +167,14 @@ default + + vendor.lineage.fastcharge + 1.0 + + IFastCharge + default + + android.hardware.wifi.supplicant 1.0-2 diff --git a/rootdir/etc/init.samsung.rc b/rootdir/etc/init.samsung.rc index 3d3d4b7..df3680f 100644 --- a/rootdir/etc/init.samsung.rc +++ b/rootdir/etc/init.samsung.rc @@ -38,6 +38,8 @@ on init symlink /dev/block/bootdevice/by-name/steady /dev/block/steady symlink /dev/block/bootdevice/by-name/persistent /dev/block/persistent + chown system radio /sys/class/sec/switch/afc_disable + # Create carrier folder for HiddenMenu on post-fs mkdir /efs/carrier 0755 system system diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te index 0df7e0d..6727844 100644 --- a/sepolicy/vendor/file.te +++ b/sepolicy/vendor/file.te @@ -9,3 +9,5 @@ allow misc_file labeledfs:filesystem associate; type spu_file, fs_type; allow spu_file labeledfs:filesystem associate; + +type sysfs_sec_switch, fs_type, sysfs_type; diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 3280a9c..929f332 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -3,9 +3,13 @@ /misc(/.*)? u:object_r:misc_file:s0 /spu(/.*)? u:object_r:spu_file:s0 +# sysfs +/sys/devices/virtual/sec/switch(/.*)? u:object_r:sysfs_sec_switch:s0 + /(vendor|system/vendor)/bin/hw/android\.hardware\.drm@1\.3-service\.widevine u:object_r:vendor_hal_drm_widevine_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.sensors@2\.1-service.samsung-multihal u:object_r:hal_sensors_default_exec:s0 /(vendor|system/vendor)/bin/factory\.ssc u:object_r:factory_ssc_exec:s0 /(vendor|system/vendor)/bin/secril_config_svc u:object_r:vendor_secril_config_svc_exec:s0 /(vendor|system/vendor)/bin/hw/android.hardware.keymaster@4.0-service.samsung u:object_r:hal_keymaster_default_exec:s0 /(vendor|system/vendor)/bin/hw/vendor.samsung.hardware.camera.provider@4.0-service u:object_r:hal_camera_default_exec:s0 +/(vendor|system/vendor)/bin/hw/vendor\.lineage\.fastcharge@1\.0-service\.samsung u:object_r:hal_lineage_fastcharge_default_exec:s0 diff --git a/sepolicy/vendor/hal_lineage_fastcharge_default.te b/sepolicy/vendor/hal_lineage_fastcharge_default.te new file mode 100644 index 0000000..f242759 --- /dev/null +++ b/sepolicy/vendor/hal_lineage_fastcharge_default.te @@ -0,0 +1,4 @@ +allow hal_lineage_fastcharge_default sysfs_sec_switch:dir search; +allow hal_lineage_fastcharge_default sysfs_sec_switch:file rw_file_perms; + +set_prop(hal_lineage_fastcharge, sec_fastcharge_prop) diff --git a/sepolicy/vendor/property.te b/sepolicy/vendor/property.te new file mode 100644 index 0000000..d32ae8b --- /dev/null +++ b/sepolicy/vendor/property.te @@ -0,0 +1 @@ +type sec_fastcharge_prop, property_type; diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts index 0b7a26c..6854421 100644 --- a/sepolicy/vendor/property_contexts +++ b/sepolicy/vendor/property_contexts @@ -4,3 +4,6 @@ vendor.sensor.file.permission u:object_r:vendor_sensors_prop: # RIL ro.vendor.multisim. u:object_r:vendor_radio_prop:s0 ro.vendor.radio. u:object_r:vendor_radio_prop:s0 + +# Fastcharge +persist.vendor.sec.fastchg_enabled u:object_r:sec_fastcharge_prop:s0