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

Commit e5b9cf8c authored by lucaslin's avatar lucaslin
Browse files

Use function inside NetdUtils instead of NetworkManagementService

TestNetworkService will be a part of mainline module, to prevent
using @hide API of NetworkManagementService in TestNetworkService,
use function inside NetdUtils instead.

Bug: 170598012
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I738066ce2f1bcd616dc582a3ff1fd77bcd660c73
parent c76df136
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ java_library {
    static_libs: [
        "net-utils-device-common",
        "net-utils-framework-common",
        "netd-client",
    ],
    apex_available: [
        "//apex_available:platform",
+4 −2
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.net.NetworkAgent;
import android.net.NetworkAgentConfig;
import android.net.NetworkCapabilities;
import android.net.NetworkProvider;
import android.net.NetworkStack;
import android.net.RouteInfo;
import android.net.StringNetworkSpecifier;
import android.net.TestNetworkInterface;
@@ -48,6 +49,7 @@ import android.util.SparseArray;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.net.module.util.NetdUtils;

import java.io.UncheckedIOException;
import java.net.Inet4Address;
@@ -316,10 +318,10 @@ class TestNetworkService extends ITestNetworkManager.Stub {
        }

        try {
            // This requires NETWORK_STACK privileges.
            final long token = Binder.clearCallingIdentity();
            try {
                mNMS.setInterfaceUp(iface);
                NetworkStack.checkNetworkStackPermission(mContext);
                NetdUtils.setInterfaceUp(mNetd, iface);
            } finally {
                Binder.restoreCallingIdentity(token);
            }