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

Commit 03e04e83 authored by Rob Barnes's avatar Rob Barnes Committed by android-build-merger
Browse files

Merge "Changed uid output parameter from an int array to a list of strings."...

Merge "Changed uid output parameter from an int array to a list of strings." am: 7eae0132 am: 4718f665
am: 23ae5088

Change-Id: Ieefd1262586a3fbcf13999193c1e058abf1e0a8e
parents 9d4d5374 23ae5088
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import java.math.BigInteger;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -320,8 +321,9 @@ public class KeyStore {
     */
    @UnsupportedAppUsage
    public int[] listUidsOfAuthBoundKeys() {
        final int MAX_RESULT_SIZE = 100;
        int[] uidsOut = new int[MAX_RESULT_SIZE];
        // uids are returned as a list of strings because list of integers
        // as an output parameter is not supported by aidl-cpp.
        List<String> uidsOut = new ArrayList<>();
        try {
            int rc = mBinder.listUidsOfAuthBoundKeys(uidsOut);
            if (rc != NO_ERROR) {
@@ -335,8 +337,8 @@ public class KeyStore {
            Log.w(TAG, "KeyStore exception", e);
            return null;
        }
        // Remove any 0 entries
        return Arrays.stream(uidsOut).filter(x -> x > 0).toArray();
        // Turn list of strings into an array of uid integers.
        return uidsOut.stream().mapToInt(Integer::parseInt).toArray();
   }

    public String[] list(String prefix) {