AN13189 provides guidelines for the integration of PN7160 NXP NCI-based NFC controller to an Android platform from software perspective. But some developers found some compile issues when integrating PN7160 NFC package into Android 11.
This article describes how to fix the build error when you integrating PN7160 NXP NCI-based NFC controller to Android 11 system. You need to follow the AN13189 (PN7160 Android porting guide ) first. After you run the installation script install_NFC.sh, the following modification should be added to the source code.
1) Open package/apps/Nfc/nci/jni/Android.bp
Add "-DNXP_EXTNS=TRUE",
2 ) open system/nfc/src/Android.bp
Add "-DNXP_EXTNS=TRUE",
3 ) open packages/apps/Nfc/src/com/android/nfc/NfcService.java
And add this: between isNfcSecureEnabled and setNfcSecure methods:
@Override
public IBinder getNfcAdapterVendorInterface(String vendor) {
if(vendor.equalsIgnoreCase("nxp")){
return (IBinder) mNfcAdapter;
} else {
return null;
}
}
Next, follow AN13189, complete the following steps in section 4.2.
Then you can build the package successfully. Thanks @andraz_skupek .
查看全文