Let us elaborate on the response of the aid in different modes ( premise: A mobile phone, a, b two HCE APP, through the reader to the mobile phone to send APDU selection instructions )
1, A and B application aid is set to the payment mode,
Only the default payment app currently selected by the phone will respond, and the other app's aid selection instructions will not respond.
2, A and B application aid is set to the other mode,
When the aid of A and B are the same, the system pops up a dialog box, listing A and b for the user to select.
If the aid of A and B are different, then there is no interaction between the two apps.
The application aid settings for 3, A and B are payment (a) and other (b) modes, respectively,
If A and B have the same aid, only a will respond to the selection instruction.
If the aid of A and B are different, then the two do not affect each other
Finally, how to determine whether the current HCE app is the default payment program and how to set it as the default payment procedure to contribute to everyone
private void Checkisdefaultapp () {cardemulation Cardemulationmanager = cardemulation.getinstance ( Nfcadapter.getdefaultadapter (this)); ComponentName paymentservicecomponent = new ComponentName (Getapplicationcontext (), CardMangerService.class.getCanonicalName ()); if (!cardemulationmanager.isdefaultserviceforcategory ( Paymentservicecomponent, cardemulation.category_payment)) {Intent Intent = new Intent (cardemulation.action_change_ DEFAULT); Intent.putextra (cardemulation.extra_category,cardemulation.category_payment); Intent.putextra ( cardemulation.extra_service_component,paymentservicecomponent); Startactivityforresult (intent, 0); L.D ("TAG", "current app is not default payment, need to set manually");} else {L.D ("TAG", "Current application is system default payment program");}}
Android HCE Development Configuration Aid Response Relationship summary