diff options
| author | Iavor-Valentin Iftime <valiiftime@google.com> | 2019-10-08 15:08:18 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-10-08 15:08:18 +0000 |
| commit | 311fc569f34a6872ef923445fccb96f8cde62c35 (patch) | |
| tree | d5a5f2922e9a2ab66bcc8bbe6c10f05df1bc5f36 /core/java/android/util/ArraySet.java | |
| parent | 04665dbfccd9705172caf2d283651499d6dacd25 (diff) | |
| parent | c86ebbaebcee107370c3b1e269862a52357af287 (diff) | |
Merge "API to detect which network interfaces support wake-on-lan"
Diffstat (limited to 'core/java/android/util/ArraySet.java')
| -rw-r--r-- | core/java/android/util/ArraySet.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/util/ArraySet.java b/core/java/android/util/ArraySet.java index 3fa914f9ad02..d6a35e1b96fc 100644 --- a/core/java/android/util/ArraySet.java +++ b/core/java/android/util/ArraySet.java @@ -16,6 +16,7 @@ package android.util; +import android.annotation.Nullable; import android.annotation.TestApi; import android.annotation.UnsupportedAppUsage; @@ -303,6 +304,18 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { } /** + * Create a new ArraySet with items from the given array + */ + public ArraySet(@Nullable E[] array) { + this(); + if (array != null) { + for (E value : array) { + add(value); + } + } + } + + /** * Make the array map empty. All storage is released. */ @Override |
