From ca1eaf28862e3ae279d6567c3ed888c8e607f81d Mon Sep 17 00:00:00 2001 From: Mark Chien Date: Mon, 27 Apr 2020 11:17:28 +0000 Subject: 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 --- common/moduleutils/src/android/net/util/InterfaceParams.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'common/moduleutils/src') 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); -- cgit v1.2.3