diff options
author | Mark Chien <markchien@google.com> | 2020-04-28 03:09:25 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-04-28 03:09:25 +0000 |
commit | 90b9ebe5f6cf77435373ebab0e14770a8bcc0d4d (patch) | |
tree | 109323d4c6edc877934e47865a8ed8aef2b01e8c /common | |
parent | 7dd51c66504ce5ea2401489f13a1bbe789241751 (diff) | |
parent | ca1eaf28862e3ae279d6567c3ed888c8e607f81d (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.java | 10 |
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); |