Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72664e11 authored by Mark Chien's avatar Mark Chien Committed by Automerger Merge Worker
Browse files

Merge "Remove Preconditions usage from moduleutils and IpClient" am: da8c70c6

Change-Id: I60a6c8ad01c827cdfbcc646c520e072f14cd2d25
parents 73abd72d da8c70c6
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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);
+2 −3
Original line number Diff line number Diff line
@@ -74,7 +74,6 @@ import com.android.internal.util.HexDump;
import com.android.internal.util.IState;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.MessageUtils;
import com.android.internal.util.Preconditions;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
import com.android.internal.util.WakeupMessage;
@@ -549,8 +548,8 @@ public class IpClient extends StateMachine {
            NetworkObserverRegistry observerRegistry, NetworkStackServiceManager nssManager,
            Dependencies deps) {
        super(IpClient.class.getSimpleName() + "." + ifName);
        Preconditions.checkNotNull(ifName);
        Preconditions.checkNotNull(callback);
        Objects.requireNonNull(ifName);
        Objects.requireNonNull(callback);

        mTag = getName();