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

Commit cbab0d13 authored by Janis Danisevskis's avatar Janis Danisevskis
Browse files

Keystore 2.0 SPI: Add forEach for int arrays to ArrayUtils

This patch adds a forEach function for int arrays to
android.security.keystore.ArrayUtils. A utility function with the
intendet use in Keystore 2.0 Key paramter handling.

Test: None
Change-Id: I2c02b300ee68fcd548c128deb0266fe603226807
parent c5bdd77f
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package android.security.keystore;

import libcore.util.EmptyArray;

import java.util.function.Consumer;

/**
 * @hide
 */
@@ -107,4 +109,16 @@ public abstract class ArrayUtils {
            return result;
        }
    }

    /**
     * Runs {@code consumer.accept()} for each element of {@code array}.
     * @param array
     * @param consumer
     * @hide
     */
    public static void forEach(int[] array, Consumer<Integer> consumer) {
        for (int i : array) {
            consumer.accept(i);
        }
    }
}