From ed3a29ea08eec2676fe157c92948d1a7e3c215a3 Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Fri, 23 Jan 2015 11:29:54 -0800 Subject: Add getPrefixAids(). Bug: 19144664 Change-Id: Ia49550102ccf1d40cd3f2bf7e5bd64d444a2e8a3 --- core/java/android/nfc/cardemulation/ApduServiceInfo.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/java/android/nfc/cardemulation/ApduServiceInfo.java b/core/java/android/nfc/cardemulation/ApduServiceInfo.java index 00b2ee3..f10e530 100644 --- a/core/java/android/nfc/cardemulation/ApduServiceInfo.java +++ b/core/java/android/nfc/cardemulation/ApduServiceInfo.java @@ -40,6 +40,7 @@ import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -262,7 +263,7 @@ public final class ApduServiceInfo implements Parcelable { * for that category. * @return List of AIDs registered by the service */ - public ArrayList getAids() { + public List getAids() { final ArrayList aids = new ArrayList(); for (AidGroup group : getAidGroups()) { aids.addAll(group.aids); @@ -270,6 +271,18 @@ public final class ApduServiceInfo implements Parcelable { return aids; } + public List getPrefixAids() { + final ArrayList prefixAids = new ArrayList(); + for (AidGroup group : getAidGroups()) { + for (String aid : group.aids) { + if (aid.endsWith("*")) { + prefixAids.add(aid); + } + } + } + return prefixAids; + } + /** * Returns the registered AID group for this category. */ -- cgit v1.1