From 5e4d14e6376bc99bec2a6fe786de178f48115d19 Mon Sep 17 00:00:00 2001 From: Arian Date: Sat, 18 May 2024 12:52:48 +0200 Subject: [PATCH] sm8450-common: Build nxp nfc service from source Change-Id: Ib2294005a1761570c4dab98b7c1a44728406b428 --- BoardConfigCommon.mk | 2 +- common.mk | 1 + proprietary-files.txt | 13 ------------- sepolicy/vendor/file_contexts | 3 +++ sepolicy/vendor/hal_nfc.te | 2 -- sepolicy/vendor/init.te | 1 - sepolicy/vendor/property.te | 3 --- sepolicy/vendor/property_contexts | 4 ---- sepolicy/vendor/service_contexts | 2 ++ vintf/manifest_nfc.xml | 24 +++++++++--------------- vintf/manifest_no_nfc.xml | 13 +++++++++++++ 11 files changed, 29 insertions(+), 39 deletions(-) create mode 100644 sepolicy/vendor/service_contexts create mode 100644 vintf/manifest_no_nfc.xml diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index ae736d6..f092214 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -235,7 +235,7 @@ $(foreach sku, $(call to-upper, $(DEVICE_MANIFEST_SKUS)), \ $(eval DEVICE_MANIFEST_$(sku)_FILES := \ $(COMMON_PATH)/vintf/manifest.xml \ $(COMMON_PATH)/vintf/manifest_xiaomi.xml \ - $(if $(TARGET_NFC_SUPPORTED_SKUS),,$(COMMON_PATH)/vintf/manifest_nfc.xml) \ + $(if $(TARGET_NFC_SUPPORTED_SKUS),$(COMMON_PATH)/vintf/manifest_no_nfc.xml,) \ )) ifneq ($(TARGET_NFC_SUPPORTED_SKUS),) diff --git a/common.mk b/common.mk index 695e923..6efece4 100644 --- a/common.mk +++ b/common.mk @@ -309,6 +309,7 @@ PRODUCT_COPY_FILES += \ # NFC PRODUCT_PACKAGES += \ + android.hardware.nfc-service.nxp \ android.hardware.nfc@1.2.vendor \ libchrome.vendor diff --git a/proprietary-files.txt b/proprietary-files.txt index ef0f9f4..16852db 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -768,20 +768,7 @@ vendor/etc/seccomp_policy/modemManager.policy vendor/etc/public.libraries.txt # NFC -vendor/bin/hw/vendor.nxp.hardware.nfc@2.0-service -vendor/bin/nqnfcinfo -vendor/bin/pnscr -vendor/bin/pnscr-mi -vendor/bin/pnscr-rf -vendor/etc/init/vendor.nxp.hardware.nfc@2.0-service.rc -vendor/lib/libsn100u_fw.so -vendor/lib/libsn220u_fw.so -vendor/lib/nfc_nci.nqx.default.hw.v1.so -vendor/lib/vendor.nxp.hardware.nfc@2.0.so vendor/lib64/libsn100u_fw.so -vendor/lib64/libsn220u_fw.so -vendor/lib64/nfc_nci.nqx.default.hw.v1.so -vendor/lib64/vendor.nxp.hardware.nfc@2.0.so # Perf vendor/bin/hw/vendor.qti.hardware.perf-hal-service diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 03165c2..131e77c 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -72,6 +72,9 @@ # Modem /dev/smd8 u:object_r:vendor_radio_smd_device:s0 +# NFC +/vendor/bin/hw/android\.hardware\.nfc-service\.nxp u:object_r:hal_nfc_default_exec:s0 + # Powershare /vendor/bin/hw/vendor\.lineage\.powershare@1\.0-service\.xiaomi u:object_r:hal_lineage_powershare_default_exec:s0 diff --git a/sepolicy/vendor/hal_nfc.te b/sepolicy/vendor/hal_nfc.te index 2695d8a..9486137 100644 --- a/sepolicy/vendor/hal_nfc.te +++ b/sepolicy/vendor/hal_nfc.te @@ -1,4 +1,2 @@ allow hal_nfc_default vendor_nfc_vendor_data_file:dir create_dir_perms; allow hal_nfc_default vendor_nfc_vendor_data_file:file create_file_perms; - -get_prop(hal_nfc_default, vendor_nfc_mi_prop) diff --git a/sepolicy/vendor/init.te b/sepolicy/vendor/init.te index 06ae4f8..fbbbb7e 100644 --- a/sepolicy/vendor/init.te +++ b/sepolicy/vendor/init.te @@ -1,7 +1,6 @@ set_prop(vendor_init, vendor_fp_prop) set_prop(vendor_init, vendor_fp_info_prop) set_prop(vendor_init, vendor_thermal_normal_prop) -set_prop(vendor_init, vendor_nfc_mi_prop) set_prop(vendor_init, vendor_ssr_prop) set_prop(vendor_init, vendor_edgnss_qxwz_downloadak_prop) set_prop(vendor_init, vendor_qcc_prop) diff --git a/sepolicy/vendor/property.te b/sepolicy/vendor/property.te index 8d7a854..de4b7b9 100644 --- a/sepolicy/vendor/property.te +++ b/sepolicy/vendor/property.te @@ -18,9 +18,6 @@ vendor_public_prop(vendor_mi_ins_prop) # Mlipay vendor_public_prop(vendor_payment_security_prop) -# NFC -vendor_public_prop(vendor_nfc_mi_prop) - # Panel vendor_public_prop(vendor_panel_info_prop) diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts index edba9a7..2d7e46d 100644 --- a/sepolicy/vendor/property_contexts +++ b/sepolicy/vendor/property_contexts @@ -35,10 +35,6 @@ persist.vendor.sys.provision.status u:object_r:vendor_payment_security_prop:s0 vendor.sys.feature_state u:object_r:vendor_payment_security_prop:s0 vendor.sys.rpmb_state u:object_r:vendor_payment_security_prop:s0 -# NFC -ro.vendor.nfc. u:object_r:vendor_nfc_mi_prop:s0 -ro.vendor.se. u:object_r:vendor_nfc_mi_prop:s0 - # Sensors persist.vendor.sensors.ins. u:object_r:vendor_mi_ins_prop:s0 persist.vendor.sensors.ins_debug u:object_r:vendor_mi_ins_prop:s0 diff --git a/sepolicy/vendor/service_contexts b/sepolicy/vendor/service_contexts new file mode 100644 index 0000000..2e7eb73 --- /dev/null +++ b/sepolicy/vendor/service_contexts @@ -0,0 +1,2 @@ +# NFC +vendor.nxp.nxpnfc_aidl.INxpNfc/default u:object_r:hal_nfc_service:s0 diff --git a/vintf/manifest_nfc.xml b/vintf/manifest_nfc.xml index d9b4c07..3df6293 100644 --- a/vintf/manifest_nfc.xml +++ b/vintf/manifest_nfc.xml @@ -1,21 +1,15 @@ + - + android.hardware.nfc - hwbinder - 1.2 - - INfc - default - + INfc/default - - vendor.nxp.hardware.nfc - hwbinder - 2.0 - - INqNfc - default - + + vendor.nxp.nxpnfc_aidl + INxpNfc/default diff --git a/vintf/manifest_no_nfc.xml b/vintf/manifest_no_nfc.xml new file mode 100644 index 0000000..015aa5c --- /dev/null +++ b/vintf/manifest_no_nfc.xml @@ -0,0 +1,13 @@ + + + + + android.hardware.nfc + + + vendor.nxp.nxpnfc_aidl + +