diff options
author | Chiachang Wang <chiachangwang@google.com> | 2019-02-25 11:31:56 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-02-25 11:31:56 -0800 |
commit | 411e10ec5e20f63f4895e0bf54be60bef9e4006c (patch) | |
tree | 6b2af8c13082555d9ece1a7870ba7c67174647c2 /src/android/net/util/NetworkStackUtils.java | |
parent | 0b89c0646a36ad6b8151640739d7f28daff57944 (diff) | |
parent | 09d3ac4e8d6ea46d618043c6c1f405d715df8665 (diff) |
Merge "Injecting data stall event to statsd" am: 2fd3ca6fa0 am: 853d1ae5ac
am: 29f2aff772
Change-Id: I9d3395e7bddd8b8bdb528454a4b3c6636141d58e
Diffstat (limited to 'src/android/net/util/NetworkStackUtils.java')
-rw-r--r-- | src/android/net/util/NetworkStackUtils.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/android/net/util/NetworkStackUtils.java b/src/android/net/util/NetworkStackUtils.java index 98123a5..481dbda 100644 --- a/src/android/net/util/NetworkStackUtils.java +++ b/src/android/net/util/NetworkStackUtils.java @@ -16,8 +16,11 @@ package android.net.util; +import android.annotation.NonNull; + import java.io.FileDescriptor; import java.io.IOException; +import java.util.List; /** * Collection of utilities for the network stack. @@ -40,4 +43,26 @@ public class NetworkStackUtils { } catch (IOException ignored) { } } + + /** + * Returns an int array from the given Integer list. + */ + public static int[] convertToIntArray(@NonNull List<Integer> list) { + int[] array = new int[list.size()]; + for (int i = 0; i < list.size(); i++) { + array[i] = list.get(i); + } + return array; + } + + /** + * Returns a long array from the given long list. + */ + public static long[] convertToLongArray(@NonNull List<Long> list) { + long[] array = new long[list.size()]; + for (int i = 0; i < list.size(); i++) { + array[i] = list.get(i); + } + return array; + } } |