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

Commit 6a47a861 authored by Martijn Coenen's avatar Martijn Coenen Committed by Gerrit Code Review
Browse files

Merge "Add getPrefixAids()."

parents 82992b72 ed3a29ea
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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<String> getAids() {
    public List<String> getAids() {
        final ArrayList<String> aids = new ArrayList<String>();
        for (AidGroup group : getAidGroups()) {
            aids.addAll(group.aids);
@@ -270,6 +271,18 @@ public final class ApduServiceInfo implements Parcelable {
        return aids;
    }

    public List<String> getPrefixAids() {
        final ArrayList<String> prefixAids = new ArrayList<String>();
        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.
     */