summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndres Morales <anmorales@google.com>2014-12-10 00:51:26 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-10 00:51:28 +0000
commitac28fac6bd5f087a9d2e6678a8f0f433b56f1f8f (patch)
treeeba4d5af7b3aa1c055bdac7b83313a247638bb32
parent02f9be4fd68f55d9552edb297ae690199dde2b12 (diff)
parentc5d3a21bf654bb84f69302bba84acfe42c745b84 (diff)
downloadandroid_packages_apps_Nfc-ac28fac6bd5f087a9d2e6678a8f0f433b56f1f8f.tar.gz
android_packages_apps_Nfc-ac28fac6bd5f087a9d2e6678a8f0f433b56f1f8f.tar.bz2
android_packages_apps_Nfc-ac28fac6bd5f087a9d2e6678a8f0f433b56f1f8f.zip
Merge "Remove asterisk from AID when removing prefix entries" into lmp-mr1-dev
-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);
}
}