summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMark Chien <markchien@google.com>2020-04-28 03:09:25 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-04-28 03:09:25 +0000
commit90b9ebe5f6cf77435373ebab0e14770a8bcc0d4d (patch)
tree109323d4c6edc877934e47865a8ed8aef2b01e8c /common
parent7dd51c66504ce5ea2401489f13a1bbe789241751 (diff)
parentca1eaf28862e3ae279d6567c3ed888c8e607f81d (diff)
Merge "Remove Preconditions usage from moduleutils and IpClient" into rvc-dev
Diffstat (limited to 'common')
-rw-r--r--common/moduleutils/src/android/net/util/InterfaceParams.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/common/moduleutils/src/android/net/util/InterfaceParams.java b/common/moduleutils/src/android/net/util/InterfaceParams.java
index 7e05a8d..0982981 100644
--- a/common/moduleutils/src/android/net/util/InterfaceParams.java
+++ b/common/moduleutils/src/android/net/util/InterfaceParams.java
@@ -16,8 +16,6 @@
package android.net.util;
-import static com.android.internal.util.Preconditions.checkArgument;
-
import android.net.MacAddress;
import android.text.TextUtils;
@@ -66,8 +64,12 @@ public class InterfaceParams {
}
public InterfaceParams(String name, int index, MacAddress macAddr, int defaultMtu) {
- checkArgument((!TextUtils.isEmpty(name)), "impossible interface name");
- checkArgument((index > 0), "invalid interface index");
+ if (TextUtils.isEmpty(name)) {
+ throw new IllegalArgumentException("impossible interface name");
+ }
+
+ if (index <= 0) throw new IllegalArgumentException("invalid interface index");
+
this.name = name;
this.index = index;
this.hasMacAddress = (macAddr != null);