diff options
author | Mark Chien <markchien@google.com> | 2020-04-27 11:17:28 +0000 |
---|---|---|
committer | Mark Chien <markchien@google.com> | 2020-04-27 12:38:42 +0000 |
commit | ca1eaf28862e3ae279d6567c3ed888c8e607f81d (patch) | |
tree | 8b6d39ddbe000de1dda2383cfa4767e1ae76ee3a /common/moduleutils/src | |
parent | f7642249714c429183745f8f0ed3cdca25dfadff (diff) |
Remove Preconditions usage from moduleutils and IpClient
moduleutils is a shared utility to be used by multiple network modules.
Stop depending on a framework private class usage. Then all of its users
can stop depending on the statically linked and jarjared private
framework class.
Bug: 148636687
Test: atest TetheringTests NetworkStackNextTests
Merged-In: I693d0318fa4f1afbc220aa7c43e614ab5714a984
Change-Id: I693d0318fa4f1afbc220aa7c43e614ab5714a984
Diffstat (limited to 'common/moduleutils/src')
-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); |