Merge "Add CollectionUtils.contains for short" am: 35570f4599

Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1802483

Change-Id: Ib6e05a150e1d72b6c740520c6100935905f8769a
diff --git a/staticlibs/framework/com/android/net/module/util/CollectionUtils.java b/staticlibs/framework/com/android/net/module/util/CollectionUtils.java
index 0696cca..9eb2c22 100644
--- a/staticlibs/framework/com/android/net/module/util/CollectionUtils.java
+++ b/staticlibs/framework/com/android/net/module/util/CollectionUtils.java
@@ -123,6 +123,19 @@
     /**
      * @return true if the array contains the specified value.
      */
+    public static boolean contains(@Nullable short[] array, short value) {
+        if (array == null) return false;
+        for (int i = 0; i < array.length; i++) {
+            if (array[i] == value) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * @return true if the array contains the specified value.
+     */
     public static boolean contains(@Nullable int[] array, int value) {
         if (array == null) return false;
         for (int element : array) {