From 68577f4f6f380e88c8a2684657b8c2a49517dc34 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Thu, 18 Sep 2025 22:09:34 +0300 Subject: [PATCH] devon: Switch to AIDL ST NFC HAL Change-Id: Ie92ad50f2bb7e98301e1e272dd1c03f93412d9a0 --- BoardConfig.mk | 1 + device.mk | 5 +++-- extract-files.py | 3 --- init/init.mmi.overlay.rc | 5 ----- init/init.vendor.st21nfc.rc | 14 ++++++++++++++ product.prop | 2 ++ proprietary-files.txt | 1 - 7 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 init/init.vendor.st21nfc.rc create mode 100644 product.prop diff --git a/BoardConfig.mk b/BoardConfig.mk index a59408f..6b365dc 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -37,6 +37,7 @@ BOOT_KERNEL_MODULES := $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD) BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 100663296 # Properties +TARGET_PRODUCT_PROP += $(DEVICE_PATH)/product.prop TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/system_ext.prop TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop diff --git a/device.mk b/device.mk index f59d8c9..ccd25e8 100644 --- a/device.mk +++ b/device.mk @@ -27,15 +27,16 @@ TARGET_SCREEN_WIDTH := 1080 # Init PRODUCT_PACKAGES += \ fstab.qcom \ + init.mmi.overlay.rc \ init.oem.fingerprint2.sh \ - init.mmi.overlay.rc + init.vendor.st21nfc.rc # LiveDisplay $(call soong_config_set,livedisplay_sysfs,enable_ab,true) # NFC PRODUCT_PACKAGES += \ - android.hardware.nfc@1.2-service.st + android.hardware.nfc-service.st # Overlay PRODUCT_PACKAGES += \ diff --git a/extract-files.py b/extract-files.py index a18660a..b5bc689 100755 --- a/extract-files.py +++ b/extract-files.py @@ -31,9 +31,6 @@ lib_fixups: lib_fixups_user_type = { } blob_fixups: blob_fixups_user_type = { - 'vendor/etc/init/android.hardware.nfc@1.2-service.st-moto.rc': blob_fixup() - .regex_replace('on property:init.svc.vendor.stflashtool=stopped &&', 'on boot &&') - .regex_replace('class hal', 'override\n class hal'), ('vendor/lib64/camera/components/com.qti.node.gpu.so', 'vendor/lib64/hw/camera.qcom.so'): blob_fixup() .binary_regex_replace(b'camera.mot.is.coming.cts', b'vendor.camera.coming.cts'), 'vendor/lib64/libBSTSWAD.so': blob_fixup() diff --git a/init/init.mmi.overlay.rc b/init/init.mmi.overlay.rc index 4994813..66d0510 100644 --- a/init/init.mmi.overlay.rc +++ b/init/init.mmi.overlay.rc @@ -52,11 +52,6 @@ on charger insmod /vendor/lib/modules/mmi_discrete_turbo_charger.ko insmod /vendor/lib/modules/tcpc_sgm7220.ko -on boot - # Change ownership and permission of st nfc device - chown nfc nfc /dev/st21nfc - chmod 0660 /dev/st21nfc - service capsense_reset /system/vendor/bin/capsense_reset class core user system diff --git a/init/init.vendor.st21nfc.rc b/init/init.vendor.st21nfc.rc new file mode 100644 index 0000000..8c965b0 --- /dev/null +++ b/init/init.vendor.st21nfc.rc @@ -0,0 +1,14 @@ +on boot + # Change ownership and permission of st nfc device + chown nfc nfc /dev/st21nfc + chmod 0660 /dev/st21nfc + +on boot && property:ro.vendor.hw.nfc=st + start vendor.st_nfc_hal_service + +service vendor.st_nfc_hal_service /vendor/bin/hw/android.hardware.nfc-service.st + override + class hal + user nfc + group nfc + disabled diff --git a/product.prop b/product.prop new file mode 100644 index 0000000..25f3765 --- /dev/null +++ b/product.prop @@ -0,0 +1,2 @@ +# NFC +persist.nfc_cfg.config_file_name=libnfc-nci-st.conf diff --git a/proprietary-files.txt b/proprietary-files.txt index 18540da..759d55a 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -196,7 +196,6 @@ vendor/usr/keylayout/uinput-fpc.kl vendor/firmware/a630_sqe.fw # NFC (ST) -vendor/etc/init/android.hardware.nfc@1.2-service.st.rc:vendor/etc/init/android.hardware.nfc@1.2-service.st-moto.rc vendor/etc/libnfc-hal-st.conf vendor/etc/libnfc-nci-st.conf vendor/etc/st21nfc_conf_ds.txt