From abdbab01cc659ba8c27e9de9274b65e8d860c79f Mon Sep 17 00:00:00 2001 From: Xiao Ma Date: Tue, 18 Jan 2022 04:49:55 +0000 Subject: [PATCH] Fix the Preconditions dependency in EthernetNetworkSpecifier. Ethernet service related files are going to be moved into Connectivity module. Replace the Preconditions class in the EthernetNetworkSpecifier, either add modules-utils-preconditions static lib dependency to fix it, however, notice that will result in the duplicate class import when moving ethernet stuff to p/m/Connectivity. Bug: 210586283 Test: atest FrameworksNetTests EthernetServiceTests Change-Id: I6163699be4126ef1b95dfb87ec9a6aba2c01195a --- framework-t/src/android/net/EthernetNetworkSpecifier.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework-t/src/android/net/EthernetNetworkSpecifier.java b/framework-t/src/android/net/EthernetNetworkSpecifier.java index 62c5761442..925d12b574 100644 --- a/framework-t/src/android/net/EthernetNetworkSpecifier.java +++ b/framework-t/src/android/net/EthernetNetworkSpecifier.java @@ -23,8 +23,6 @@ import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; -import com.android.internal.util.Preconditions; - import java.util.Objects; /** @@ -47,7 +45,9 @@ public final class EthernetNetworkSpecifier extends NetworkSpecifier implements * @param interfaceName Name of the ethernet interface the specifier refers to. */ public EthernetNetworkSpecifier(@NonNull String interfaceName) { - Preconditions.checkStringNotEmpty(interfaceName); + if (TextUtils.isEmpty(interfaceName)) { + throw new IllegalArgumentException(); + } mInterfaceName = interfaceName; }