Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix nfc on some huawei devices #194

Open
wants to merge 1 commit into
base: android-10.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ PRODUCT_COPY_FILES += \
device/phh/treble/nfc/libnfc-nci.conf:system/phh/libnfc-nci-oreo.conf \
device/phh/treble/nfc/libnfc-nci-huawei.conf:system/phh/libnfc-nci-huawei.conf

PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/android.hardware.nfc.hcef.xml \
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/android.hardware.nfc.hce.xml \
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/android.hardware.nfc.xml \
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/com.nxp.mifare.xml

PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.hardware.nfc.hcef.xml \
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.hardware.nfc.hce.xml \
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.hardware.nfc.xml \
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/com.nxp.mifare.xml

# LineageOS build may need this to make NFC work
PRODUCT_PACKAGES += \
NfcNci \
Expand Down
4 changes: 4 additions & 0 deletions rw-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@ if getprop ro.vendor.build.fingerprint | grep -iq -e xiaomi/daisy; then
fi

if getprop ro.vendor.build.fingerprint | grep -iq -E -e 'huawei|honor' || getprop persist.sys.overlay.huawei | grep -iq -E -e 'true'; then
p=/odm/etc/libnfc-brcm.conf
mount -o bind "$p" /system/etc/libnfc-brcm.conf ||
mount -o bind /odm/etc/libnfc-brcm.conf /system/etc/libnfc-nci.conf || true

p=/product/etc/nfc/libnfc_nxp_*_*.conf
mount -o bind "$p" /system/etc/libnfc-nxp.conf ||
mount -o bind /product/etc/libnfc-nxp.conf /system/etc/libnfc-nxp.conf || true
Expand Down