Android supports NFC card emulation with a secure element for off-host card emulation. (For more information, see Host-based card emulation overview.) However, on the Android platform, the preferred payment service specified in the Tap & pay setting isn't always synchronized with the app in the secure element. This means it's possible that a nonpreferred payment service in the secure element is used instead of the preferred payment service.
In Android 11, the off-host payment synchronization feature provides a mechanism that lets you synchronize the payment configuration in Tap & pay, the routing configuration on the contactless frontend (CLF), and the app-selected state in the secure element.
The following diagram illustrates the design architecture of the off-host payment synchronization feature.
Implementation
To implement the off-host payment synchronization feature, the device must have an NFC controller that supports the NCI 2.0 standard and must use the Android Open Source Project NFC and Open Mobile Application Programming Interface (OMAPI) frameworks.
Framework APIs
To implement off-host payment synchronization, use the following framework APIs found in the Android Open Source Project:
getAidsForPreferredPaymentService()
: Retrieves the registered AIDs for the preferred payment service.getRouteDestinationForPreferredPaymentService()
: Retrieves the route destination for the preferred payment service.getDescriptionForPreferredPaymentService()
: Returns a user-visible description of the preferred payment service.android.permission.NFC_PREFERRED_PAYMENT_INFO
(permission): Allows apps to receive NFC preferred payment service information.android.nfc.action.PREFERRED_PAYMENT_CHANGED
(broadcast action): Intent to notify if the preferred payment service changed.
Validation
To validate your implementation of the off-host payment synchronization feature, install secure element apps with corresponding secure elements and then check for appropriate responses from an NFC reader in different conditions.