Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da6ffa06 authored by Martijn Coenen's avatar Martijn Coenen Committed by Android (Google) Code Review
Browse files

Merge "Upper-case incoming AIDs." into lmp-dev

parents 7118220c 5e991a12
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -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");
+3 −3
Original line number Diff line number Diff line
@@ -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,