am 95bd8257: am 15af6c4e: Merge "Upper-case incoming AIDs." into lmp-dev

* commit '95bd8257caa7d0cff6dfb06bec6d72361d4f6625':
  Upper-case incoming AIDs.
This commit is contained in:
Martijn Coenen
2014-09-18 20:56:34 +00:00
committed by Android Git Automerger
2 changed files with 8 additions and 9 deletions

View File

@@ -15,10 +15,6 @@ import android.util.Log;
/**
* The AidGroup class represents a group of Application Identifiers (AIDs).
*
* <p>An instance of this object can be used with
* {@link CardEmulation#registerAidsForService(android.content.ComponentName, String, java.util.List)}
* to tell the OS which AIDs are handled by your HCE- or SE-based service.
*
* <p>The format of AIDs is defined in the ISO/IEC 7816-4 specification. This class
* requires the AIDs to be input as a hexadecimal string, with an even amount of
* hexadecimal characters, e.g. "F014811481".
@@ -60,7 +56,10 @@ public final class AidGroup implements Parcelable {
} else {
this.category = CardEmulation.CATEGORY_OTHER;
}
this.aids = aids;
this.aids = new ArrayList<String>(aids.size());
for (String aid : aids) {
this.aids.add(aid.toUpperCase());
}
this.description = null;
}
@@ -144,7 +143,7 @@ public final class AidGroup implements Parcelable {
if (inGroup) {
String aid = parser.getAttributeValue(null, "value");
if (aid != null) {
aids.add(aid);
aids.add(aid.toUpperCase());
}
} else {
Log.d(TAG, "Ignoring <aid> tag while not in group");

View File

@@ -311,7 +311,7 @@ public final class ApduServiceInfo implements Parcelable {
public String getCategoryForAid(String aid) {
ArrayList<AidGroup> groups = getAidGroups();
for (AidGroup group : groups) {
if (group.aids.contains(aid)) {
if (group.aids.contains(aid.toUpperCase())) {
return group.category;
}
}
@@ -425,7 +425,7 @@ public final class ApduServiceInfo implements Parcelable {
public ApduServiceInfo createFromParcel(Parcel source) {
ResolveInfo info = ResolveInfo.CREATOR.createFromParcel(source);
String description = source.readString();
boolean onHost = (source.readInt() != 0) ? true : false;
boolean onHost = source.readInt() != 0;
ArrayList<AidGroup> staticAidGroups = new ArrayList<AidGroup>();
int numStaticGroups = source.readInt();
if (numStaticGroups > 0) {
@@ -436,7 +436,7 @@ public final class ApduServiceInfo implements Parcelable {
if (numDynamicGroups > 0) {
source.readTypedList(dynamicAidGroups, AidGroup.CREATOR);
}
boolean requiresUnlock = (source.readInt() != 0) ? true : false;
boolean requiresUnlock = source.readInt() != 0;
int bannerResource = source.readInt();
int uid = source.readInt();
return new ApduServiceInfo(info, onHost, description, staticAidGroups,