summaryrefslogtreecommitdiff
path: root/src/android/net/util/NetworkStackUtils.java
diff options
context:
space:
mode:
authorRemi NGUYEN VAN <reminv@google.com>2019-01-20 13:48:19 +0900
committerRemi NGUYEN VAN <reminv@google.com>2019-01-28 13:45:27 +0900
commitabeaaf7473259517c872f6c0906bf6d0eb88be46 (patch)
tree1f260027987b68b181e23c2e7a05df29d11274c9 /src/android/net/util/NetworkStackUtils.java
parent82b4b420fde4b5019a6294cc92b4d214d3168c6c (diff)
Add hidden utils and constants to NetworkStack
Test: atest FrameworksNetTests NetworkStackTests Bug: 112869080 Change-Id: I1a803f7954ab760294436226d6c1cffb934e98f9
Diffstat (limited to 'src/android/net/util/NetworkStackUtils.java')
-rw-r--r--src/android/net/util/NetworkStackUtils.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/android/net/util/NetworkStackUtils.java b/src/android/net/util/NetworkStackUtils.java
new file mode 100644
index 0000000..6dcf0c0
--- /dev/null
+++ b/src/android/net/util/NetworkStackUtils.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.util;
+
+/**
+ * Collection of utilities for the network stack.
+ */
+public class NetworkStackUtils {
+
+ /**
+ * @return True if the array is null or 0-length.
+ */
+ public static <T> boolean isEmpty(T[] array) {
+ return array == null || array.length == 0;
+ }
+}