summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Chaisson <chaisson@broadcom.com>2014-12-07 13:29:35 -0500
committerAndres Morales <anmorales@google.com>2014-12-08 13:48:02 -0800
commitc5d3a21bf654bb84f69302bba84acfe42c745b84 (patch)
tree5b2a4c010ea453116d26d902a8c01627d6222c86
parent95302c119feba7f50a5193861619346908a96164 (diff)
downloadandroid_packages_apps_Nfc-c5d3a21bf654bb84f69302bba84acfe42c745b84.tar.gz
android_packages_apps_Nfc-c5d3a21bf654bb84f69302bba84acfe42c745b84.tar.bz2
android_packages_apps_Nfc-c5d3a21bf654bb84f69302bba84acfe42c745b84.zip
Remove asterisk from AID when removing prefix entries
Bug:18663996 Change-Id: Ic4cb547ed3c8072599e271bddb63cce875834c4e
-rw-r--r--src/com/android/nfc/cardemulation/AidRoutingManager.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/nfc/cardemulation/AidRoutingManager.java b/src/com/android/nfc/cardemulation/AidRoutingManager.java
index a727989d..96225b71 100644
--- a/src/com/android/nfc/cardemulation/AidRoutingManager.java
+++ b/src/com/android/nfc/cardemulation/AidRoutingManager.java
@@ -88,7 +88,23 @@ public class AidRoutingManager {
void clearNfcRoutingTableLocked() {
for (Map.Entry<String, Integer> aidEntry : mRouteForAid.entrySet()) {
- NfcService.getInstance().unrouteAids(aidEntry.getKey());
+ String aid = aidEntry.getKey();
+ if (aid.endsWith("*")) {
+ if (mAidMatchingSupport == AID_MATCHING_EXACT_ONLY) {
+ Log.e(TAG, "Device does not support prefix AIDs but AID [" + aid
+ + "] is registered");
+ } else if (mAidMatchingSupport == AID_MATCHING_PREFIX_ONLY) {
+ if (DBG) Log.d(TAG, "Unrouting prefix AID " + aid);
+ // Cut off '*' since controller anyway treats all AIDs as a prefix
+ aid = aid.substring(0, aid.length() - 1);
+ } else if (mAidMatchingSupport == AID_MATCHING_EXACT_OR_PREFIX) {
+ if (DBG) Log.d(TAG, "Unrouting prefix AID " + aid);
+ }
+ } else {
+ if (DBG) Log.d(TAG, "Unrouting exact AID " + aid);
+ }
+
+ NfcService.getInstance().unrouteAids(aid);
}
}