Use NetdUtils instead of NetworkManagementService in IpSecService

NetdUtils has the same method(e.g. setInterfaceUp) as
NetworkManagementService so using the one inside NetdUtils instead
and try to remove NetworkManagementService from IpSecService in
the following commit.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I0ed8b0c678b067a655b51b938b6b40eadd985321
This commit is contained in:
lucaslin
2021-02-03 23:59:45 +08:00
parent 61a6c947ff
commit ff6fe7ba53

View File

@@ -62,6 +62,7 @@ import android.util.SparseBooleanArray;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.Preconditions;
import com.android.net.module.util.NetdUtils;
import libcore.io.IoUtils;
@@ -1317,7 +1318,7 @@ public class IpSecService extends IIpSecService.Stub {
netd.ipSecAddTunnelInterface(intfName, localAddr, remoteAddr, ikey, okey, resourceId);
Binder.withCleanCallingIdentity(() -> {
mNetworkManager.setInterfaceUp(intfName);
NetdUtils.setInterfaceUp(netd, intfName);
});
for (int selAddrFamily : ADDRESS_FAMILIES) {