From 3f39e29ae723e4546794fe9b8ee23d48a2c058ae Mon Sep 17 00:00:00 2001 From: Tim Zimmerman Date: Sun, 25 Apr 2021 15:24:58 +0200 Subject: [PATCH] sm7125-common: nfc: move data to /data/vendor/nfc Change-Id: Ifcb90cd3e2dd47211207509cec3617e58c93907e --- common.mk | 7 +++---- configs/nfc/libnfc-nci.conf | 2 +- configs/nfc/nfcee_access.xml | 25 ------------------------- rootdir/etc/init.nfc.samsung.rc | 10 ---------- sepolicy/vendor/file.te | 1 + sepolicy/vendor/file_contexts | 1 - sepolicy/vendor/hal_nfc_default.te | 3 +++ sepolicy/vendor/nfc.te | 2 ++ 8 files changed, 10 insertions(+), 41 deletions(-) delete mode 100644 configs/nfc/nfcee_access.xml create mode 100644 sepolicy/vendor/nfc.te diff --git a/common.mk b/common.mk index fc2a34d..26c0680 100644 --- a/common.mk +++ b/common.mk @@ -258,15 +258,13 @@ PRODUCT_PACKAGES += \ # NFC PRODUCT_PACKAGES += \ android.hardware.nfc@1.2-service.samsung \ - libnfc-nci \ - libnfc_nci_jni \ + com.android.nfc_extras \ NfcNci \ Tag PRODUCT_COPY_FILES += \ $(COMMON_PATH)/configs/nfc/libnfc-sec-vendor.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-sec-vendor.conf \ - $(COMMON_PATH)/configs/nfc/nfcee_access.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/nfcee_access.xml \ - $(COMMON_PATH)/configs/nfc/libnfc-nci.conf:$(TARGET_COPY_OUT_SYSTEM)/etc/libnfc-nci.conf + $(COMMON_PATH)/configs/nfc/libnfc-nci.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-nci.conf # OMX PRODUCT_PACKAGES += \ @@ -302,6 +300,7 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hce.xml \ frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.uicc.xml \ frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.xml \ + frameworks/native/data/etc/com.android.nfc_extras.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.android.nfc_extras.xml \ frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \ frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \ frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \ diff --git a/configs/nfc/libnfc-nci.conf b/configs/nfc/libnfc-nci.conf index 9971bc5..a33e6b8 100644 --- a/configs/nfc/libnfc-nci.conf +++ b/configs/nfc/libnfc-nci.conf @@ -12,7 +12,7 @@ NFC_DEBUG_ENABLED=1 ############################################################################### # File used for NFA storage -NFA_STORAGE="/data/nfc" +NFA_STORAGE="/data/vendor/nfc" PRESERVE_STORAGE=0x01 ############################################################################### diff --git a/configs/nfc/nfcee_access.xml b/configs/nfc/nfcee_access.xml deleted file mode 100644 index 830b4ad..0000000 --- a/configs/nfc/nfcee_access.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rootdir/etc/init.nfc.samsung.rc b/rootdir/etc/init.nfc.samsung.rc index 9aa004c..d81f020 100644 --- a/rootdir/etc/init.nfc.samsung.rc +++ b/rootdir/etc/init.nfc.samsung.rc @@ -31,19 +31,9 @@ on boot chmod 0660 /dev/st54spi chown system system /dev/st54spi -# NFC: create data/nfc for nv storage - mkdir /data/nfc 0770 nfc nfc - mkdir /data/nfc/param 0770 nfc nfc - # NFC: /efs/nfc for nv storage mkdir /efs/nfc 0700 nfc nfc -# NFC KEY - mkdir /data/nfc_log 0750 nfc system -# copy /system/etc/nfc_key /data/nfc/Key - chmod 660 /data/nfc/Key - chown nfc nfc /data/nfc/Key - # For NFC hardware SKU on boot && property:ro.boot.nfc.feature.chipname=* setprop ro.vendor.nfc.feature.chipname ${ro.boot.nfc.feature.chipname} diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te index 6d1bf5b..5e97588 100644 --- a/sepolicy/vendor/file.te +++ b/sepolicy/vendor/file.te @@ -24,6 +24,7 @@ type sysfs_wifi_writable, sysfs_type, rw_fs_type, fs_type; ### DATA type biometrics_vendor_data_file, file_type, data_file_type; +type nfc_vendor_data_file, file_type, data_file_type; type conn_vendor_data_file, file_type, data_file_type; type radio_vendor_data_file, file_type, data_file_type; type gatekeeper_vendor_data_file, file_type, data_file_type; diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index bd0acaf..ec10115 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -2,7 +2,6 @@ /data/vendor/biometrics(/.*)? u:object_r:biometrics_vendor_data_file:s0 /data/vendor/conn(/.*)? u:object_r:conn_vendor_data_file:s0 /data/vendor/secradio(/.*)? u:object_r:radio_vendor_data_file:s0 -/data/nfc_log(/.*)? u:object_r:nfc_data_file:s0 /data/vendor/gatekeeper(/.*)? u:object_r:gatekeeper_vendor_data_file:s0 # DEV diff --git a/sepolicy/vendor/hal_nfc_default.te b/sepolicy/vendor/hal_nfc_default.te index e6a4bb8..462594b 100644 --- a/sepolicy/vendor/hal_nfc_default.te +++ b/sepolicy/vendor/hal_nfc_default.te @@ -1,2 +1,5 @@ # /dev/sec-nfc allow hal_nfc_default nfc_device:chr_file { read write open ioctl }; + +# /data/vendor/nfc +allow hal_nfc_default vendor_nfc_vendor_data_file:dir { create_dir_perms create_file_perms search }; \ No newline at end of file diff --git a/sepolicy/vendor/nfc.te b/sepolicy/vendor/nfc.te new file mode 100644 index 0000000..4e32c60 --- /dev/null +++ b/sepolicy/vendor/nfc.te @@ -0,0 +1,2 @@ +allow nfc vendor_nfc_vendor_data_file:dir rw_dir_perms; +allow nfc vendor_nfc_vendor_data_file:file create_file_perms; \ No newline at end of file