Merge changes Iec53a9fd,Iac4cfe70 am: 8621e44c39
am: 4a4e693e3e
Change-Id: I56af4e9a82f66e507d2360822af27a39e0fcb238
This commit is contained in:
@@ -4879,7 +4879,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
final NetworkCapabilities nc = new NetworkCapabilities(networkCapabilities);
|
final NetworkCapabilities nc = new NetworkCapabilities(networkCapabilities);
|
||||||
final NetworkAgentInfo nai = new NetworkAgentInfo(messenger, new AsyncChannel(),
|
final NetworkAgentInfo nai = new NetworkAgentInfo(messenger, new AsyncChannel(),
|
||||||
new Network(reserveNetId()), new NetworkInfo(networkInfo), lp, nc, currentScore,
|
new Network(reserveNetId()), new NetworkInfo(networkInfo), lp, nc, currentScore,
|
||||||
mContext, mTrackerHandler, new NetworkMisc(networkMisc), this);
|
mContext, mTrackerHandler, new NetworkMisc(networkMisc), this, mNetd, mNMS);
|
||||||
// Make sure the network capabilities reflect what the agent info says.
|
// Make sure the network capabilities reflect what the agent info says.
|
||||||
nai.networkCapabilities = mixInCapabilities(nai, nc);
|
nai.networkCapabilities = mixInCapabilities(nai, nc);
|
||||||
final String extraInfo = networkInfo.getExtraInfo();
|
final String extraInfo = networkInfo.getExtraInfo();
|
||||||
|
|||||||
@@ -16,8 +16,9 @@
|
|||||||
|
|
||||||
package com.android.server.connectivity;
|
package com.android.server.connectivity;
|
||||||
|
|
||||||
import android.net.InterfaceConfiguration;
|
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
|
import android.net.INetd;
|
||||||
|
import android.net.InterfaceConfiguration;
|
||||||
import android.net.LinkAddress;
|
import android.net.LinkAddress;
|
||||||
import android.net.LinkProperties;
|
import android.net.LinkProperties;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
@@ -59,6 +60,7 @@ public class Nat464Xlat extends BaseNetworkObserver {
|
|||||||
NetworkInfo.State.SUSPENDED,
|
NetworkInfo.State.SUSPENDED,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private final INetd mNetd;
|
||||||
private final INetworkManagementService mNMService;
|
private final INetworkManagementService mNMService;
|
||||||
|
|
||||||
// The network we're running on, and its type.
|
// The network we're running on, and its type.
|
||||||
@@ -76,7 +78,8 @@ public class Nat464Xlat extends BaseNetworkObserver {
|
|||||||
private String mIface;
|
private String mIface;
|
||||||
private State mState = State.IDLE;
|
private State mState = State.IDLE;
|
||||||
|
|
||||||
public Nat464Xlat(INetworkManagementService nmService, NetworkAgentInfo nai) {
|
public Nat464Xlat(NetworkAgentInfo nai, INetd netd, INetworkManagementService nmService) {
|
||||||
|
mNetd = netd;
|
||||||
mNMService = nmService;
|
mNMService = nmService;
|
||||||
mNetwork = nai;
|
mNetwork = nai;
|
||||||
}
|
}
|
||||||
@@ -140,7 +143,7 @@ public class Nat464Xlat extends BaseNetworkObserver {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
mNMService.startClatd(baseIface);
|
mNetd.clatdStart(baseIface);
|
||||||
} catch(RemoteException|IllegalStateException e) {
|
} catch(RemoteException|IllegalStateException e) {
|
||||||
Slog.e(TAG, "Error starting clatd on " + baseIface, e);
|
Slog.e(TAG, "Error starting clatd on " + baseIface, e);
|
||||||
}
|
}
|
||||||
@@ -162,7 +165,7 @@ public class Nat464Xlat extends BaseNetworkObserver {
|
|||||||
*/
|
*/
|
||||||
private void enterStoppingState() {
|
private void enterStoppingState() {
|
||||||
try {
|
try {
|
||||||
mNMService.stopClatd(mBaseIface);
|
mNetd.clatdStop(mBaseIface);
|
||||||
} catch(RemoteException|IllegalStateException e) {
|
} catch(RemoteException|IllegalStateException e) {
|
||||||
Slog.e(TAG, "Error stopping clatd on " + mBaseIface, e);
|
Slog.e(TAG, "Error stopping clatd on " + mBaseIface, e);
|
||||||
}
|
}
|
||||||
@@ -204,7 +207,7 @@ public class Nat464Xlat extends BaseNetworkObserver {
|
|||||||
Slog.e(TAG, "startClat: Can't start clat on null interface");
|
Slog.e(TAG, "startClat: Can't start clat on null interface");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO: should we only do this if mNMService.startClatd() succeeds?
|
// TODO: should we only do this if mNetd.clatdStart() succeeds?
|
||||||
Slog.i(TAG, "Starting clatd on " + baseIface);
|
Slog.i(TAG, "Starting clatd on " + baseIface);
|
||||||
enterStartingState(baseIface);
|
enterStartingState(baseIface);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.android.server.connectivity;
|
package com.android.server.connectivity;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.net.INetd;
|
||||||
import android.net.INetworkMonitor;
|
import android.net.INetworkMonitor;
|
||||||
import android.net.LinkProperties;
|
import android.net.LinkProperties;
|
||||||
import android.net.Network;
|
import android.net.Network;
|
||||||
@@ -239,12 +240,15 @@ public class NetworkAgentInfo implements Comparable<NetworkAgentInfo> {
|
|||||||
private static final String TAG = ConnectivityService.class.getSimpleName();
|
private static final String TAG = ConnectivityService.class.getSimpleName();
|
||||||
private static final boolean VDBG = false;
|
private static final boolean VDBG = false;
|
||||||
private final ConnectivityService mConnService;
|
private final ConnectivityService mConnService;
|
||||||
|
private final INetd mNetd;
|
||||||
|
private final INetworkManagementService mNMS;
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final Handler mHandler;
|
private final Handler mHandler;
|
||||||
|
|
||||||
public NetworkAgentInfo(Messenger messenger, AsyncChannel ac, Network net, NetworkInfo info,
|
public NetworkAgentInfo(Messenger messenger, AsyncChannel ac, Network net, NetworkInfo info,
|
||||||
LinkProperties lp, NetworkCapabilities nc, int score, Context context, Handler handler,
|
LinkProperties lp, NetworkCapabilities nc, int score, Context context, Handler handler,
|
||||||
NetworkMisc misc, ConnectivityService connService) {
|
NetworkMisc misc, ConnectivityService connService, INetd netd,
|
||||||
|
INetworkManagementService nms) {
|
||||||
this.messenger = messenger;
|
this.messenger = messenger;
|
||||||
asyncChannel = ac;
|
asyncChannel = ac;
|
||||||
network = net;
|
network = net;
|
||||||
@@ -253,6 +257,8 @@ public class NetworkAgentInfo implements Comparable<NetworkAgentInfo> {
|
|||||||
networkCapabilities = nc;
|
networkCapabilities = nc;
|
||||||
currentScore = score;
|
currentScore = score;
|
||||||
mConnService = connService;
|
mConnService = connService;
|
||||||
|
mNetd = netd;
|
||||||
|
mNMS = nms;
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mHandler = handler;
|
mHandler = handler;
|
||||||
networkMisc = misc;
|
networkMisc = misc;
|
||||||
@@ -587,18 +593,18 @@ public class NetworkAgentInfo implements Comparable<NetworkAgentInfo> {
|
|||||||
|
|
||||||
public void updateClat(INetworkManagementService netd) {
|
public void updateClat(INetworkManagementService netd) {
|
||||||
if (Nat464Xlat.requiresClat(this)) {
|
if (Nat464Xlat.requiresClat(this)) {
|
||||||
maybeStartClat(netd);
|
maybeStartClat();
|
||||||
} else {
|
} else {
|
||||||
maybeStopClat();
|
maybeStopClat();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Ensure clat has started for this network. */
|
/** Ensure clat has started for this network. */
|
||||||
public void maybeStartClat(INetworkManagementService netd) {
|
public void maybeStartClat() {
|
||||||
if (clatd != null && clatd.isStarted()) {
|
if (clatd != null && clatd.isStarted()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clatd = new Nat464Xlat(netd, this);
|
clatd = new Nat464Xlat(this, mNetd, mNMS);
|
||||||
clatd.start();
|
clatd.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -849,6 +849,18 @@ public class LinkPropertiesTest {
|
|||||||
assertEquals(new ArraySet<>(expectRemoved), (new ArraySet<>(result.removed)));
|
assertEquals(new ArraySet<>(expectRemoved), (new ArraySet<>(result.removed)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void assertParcelingIsLossless(LinkProperties source) {
|
||||||
|
Parcel p = Parcel.obtain();
|
||||||
|
source.writeToParcel(p, /* flags */ 0);
|
||||||
|
p.setDataPosition(0);
|
||||||
|
final byte[] marshalled = p.marshall();
|
||||||
|
p = Parcel.obtain();
|
||||||
|
p.unmarshall(marshalled, 0, marshalled.length);
|
||||||
|
p.setDataPosition(0);
|
||||||
|
LinkProperties dest = LinkProperties.CREATOR.createFromParcel(p);
|
||||||
|
assertEquals(source, dest);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLinkPropertiesParcelable() throws Exception {
|
public void testLinkPropertiesParcelable() throws Exception {
|
||||||
LinkProperties source = new LinkProperties();
|
LinkProperties source = new LinkProperties();
|
||||||
@@ -870,15 +882,12 @@ public class LinkPropertiesTest {
|
|||||||
|
|
||||||
source.setNat64Prefix(new IpPrefix("2001:db8:1:2:64:64::/96"));
|
source.setNat64Prefix(new IpPrefix("2001:db8:1:2:64:64::/96"));
|
||||||
|
|
||||||
Parcel p = Parcel.obtain();
|
assertParcelingIsLossless(source);
|
||||||
source.writeToParcel(p, /* flags */ 0);
|
}
|
||||||
p.setDataPosition(0);
|
|
||||||
final byte[] marshalled = p.marshall();
|
|
||||||
p = Parcel.obtain();
|
|
||||||
p.unmarshall(marshalled, 0, marshalled.length);
|
|
||||||
p.setDataPosition(0);
|
|
||||||
LinkProperties dest = LinkProperties.CREATOR.createFromParcel(p);
|
|
||||||
|
|
||||||
assertEquals(source, dest);
|
@Test
|
||||||
|
public void testParcelUninitialized() throws Exception {
|
||||||
|
LinkProperties empty = new LinkProperties();
|
||||||
|
assertParcelingIsLossless(empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4683,7 +4683,7 @@ public class ConnectivityServiceTest {
|
|||||||
mCellNetworkAgent.sendLinkProperties(cellLp);
|
mCellNetworkAgent.sendLinkProperties(cellLp);
|
||||||
mCellNetworkAgent.connect(true);
|
mCellNetworkAgent.connect(true);
|
||||||
networkCallback.expectAvailableThenValidatedCallbacks(mCellNetworkAgent);
|
networkCallback.expectAvailableThenValidatedCallbacks(mCellNetworkAgent);
|
||||||
verify(mNetworkManagementService, times(1)).startClatd(MOBILE_IFNAME);
|
verify(mMockNetd, times(1)).clatdStart(MOBILE_IFNAME);
|
||||||
Nat464Xlat clat = mService.getNat464Xlat(mCellNetworkAgent);
|
Nat464Xlat clat = mService.getNat464Xlat(mCellNetworkAgent);
|
||||||
|
|
||||||
// Clat iface up, expect stack link updated.
|
// Clat iface up, expect stack link updated.
|
||||||
@@ -4710,7 +4710,7 @@ public class ConnectivityServiceTest {
|
|||||||
mCellNetworkAgent.sendLinkProperties(cellLp);
|
mCellNetworkAgent.sendLinkProperties(cellLp);
|
||||||
waitForIdle();
|
waitForIdle();
|
||||||
networkCallback.expectCallback(CallbackState.LINK_PROPERTIES, mCellNetworkAgent);
|
networkCallback.expectCallback(CallbackState.LINK_PROPERTIES, mCellNetworkAgent);
|
||||||
verify(mNetworkManagementService, times(1)).stopClatd(MOBILE_IFNAME);
|
verify(mMockNetd, times(1)).clatdStop(MOBILE_IFNAME);
|
||||||
|
|
||||||
// Clat iface removed, expect linkproperties revert to original one
|
// Clat iface removed, expect linkproperties revert to original one
|
||||||
clat.interfaceRemoved(CLAT_PREFIX + MOBILE_IFNAME);
|
clat.interfaceRemoved(CLAT_PREFIX + MOBILE_IFNAME);
|
||||||
|
|||||||
@@ -32,11 +32,13 @@ import android.app.PendingIntent;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
|
import android.net.INetd;
|
||||||
import android.net.Network;
|
import android.net.Network;
|
||||||
import android.net.NetworkCapabilities;
|
import android.net.NetworkCapabilities;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.NetworkMisc;
|
import android.net.NetworkMisc;
|
||||||
import android.net.NetworkStack;
|
import android.net.NetworkStack;
|
||||||
|
import android.os.INetworkManagementService;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.text.format.DateUtils;
|
import android.text.format.DateUtils;
|
||||||
@@ -66,6 +68,8 @@ public class LingerMonitorTest {
|
|||||||
LingerMonitor mMonitor;
|
LingerMonitor mMonitor;
|
||||||
|
|
||||||
@Mock ConnectivityService mConnService;
|
@Mock ConnectivityService mConnService;
|
||||||
|
@Mock INetd mNetd;
|
||||||
|
@Mock INetworkManagementService mNMS;
|
||||||
@Mock Context mCtx;
|
@Mock Context mCtx;
|
||||||
@Mock NetworkMisc mMisc;
|
@Mock NetworkMisc mMisc;
|
||||||
@Mock NetworkNotificationManager mNotifier;
|
@Mock NetworkNotificationManager mNotifier;
|
||||||
@@ -352,7 +356,7 @@ public class LingerMonitorTest {
|
|||||||
caps.addCapability(0);
|
caps.addCapability(0);
|
||||||
caps.addTransportType(transport);
|
caps.addTransportType(transport);
|
||||||
NetworkAgentInfo nai = new NetworkAgentInfo(null, null, new Network(netId), info, null,
|
NetworkAgentInfo nai = new NetworkAgentInfo(null, null, new Network(netId), info, null,
|
||||||
caps, 50, mCtx, null, mMisc, mConnService);
|
caps, 50, mCtx, null, mMisc, mConnService, mNetd, mNMS);
|
||||||
nai.everValidated = true;
|
nai.everValidated = true;
|
||||||
return nai;
|
return nai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,9 +17,7 @@
|
|||||||
package com.android.server.connectivity;
|
package com.android.server.connectivity;
|
||||||
|
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.Mockito.any;
|
|
||||||
import static org.mockito.Mockito.eq;
|
import static org.mockito.Mockito.eq;
|
||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
@@ -27,6 +25,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
|||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
|
import android.net.INetd;
|
||||||
import android.net.InterfaceConfiguration;
|
import android.net.InterfaceConfiguration;
|
||||||
import android.net.LinkAddress;
|
import android.net.LinkAddress;
|
||||||
import android.net.LinkProperties;
|
import android.net.LinkProperties;
|
||||||
@@ -57,6 +56,7 @@ public class Nat464XlatTest {
|
|||||||
|
|
||||||
@Mock ConnectivityService mConnectivity;
|
@Mock ConnectivityService mConnectivity;
|
||||||
@Mock NetworkMisc mMisc;
|
@Mock NetworkMisc mMisc;
|
||||||
|
@Mock INetd mNetd;
|
||||||
@Mock INetworkManagementService mNms;
|
@Mock INetworkManagementService mNms;
|
||||||
@Mock InterfaceConfiguration mConfig;
|
@Mock InterfaceConfiguration mConfig;
|
||||||
@Mock NetworkAgentInfo mNai;
|
@Mock NetworkAgentInfo mNai;
|
||||||
@@ -65,7 +65,7 @@ public class Nat464XlatTest {
|
|||||||
Handler mHandler;
|
Handler mHandler;
|
||||||
|
|
||||||
Nat464Xlat makeNat464Xlat() {
|
Nat464Xlat makeNat464Xlat() {
|
||||||
return new Nat464Xlat(mNms, mNai);
|
return new Nat464Xlat(mNai, mNetd, mNms);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
@@ -129,7 +129,7 @@ public class Nat464XlatTest {
|
|||||||
nat.start();
|
nat.start();
|
||||||
|
|
||||||
verify(mNms).registerObserver(eq(nat));
|
verify(mNms).registerObserver(eq(nat));
|
||||||
verify(mNms).startClatd(eq(BASE_IFACE));
|
verify(mNetd).clatdStart(eq(BASE_IFACE));
|
||||||
|
|
||||||
// Stacked interface up notification arrives.
|
// Stacked interface up notification arrives.
|
||||||
nat.interfaceLinkStateChanged(STACKED_IFACE, true);
|
nat.interfaceLinkStateChanged(STACKED_IFACE, true);
|
||||||
@@ -144,7 +144,7 @@ public class Nat464XlatTest {
|
|||||||
// ConnectivityService stops clat (Network disconnects, IPv4 addr appears, ...).
|
// ConnectivityService stops clat (Network disconnects, IPv4 addr appears, ...).
|
||||||
nat.stop();
|
nat.stop();
|
||||||
|
|
||||||
verify(mNms).stopClatd(eq(BASE_IFACE));
|
verify(mNetd).clatdStop(eq(BASE_IFACE));
|
||||||
|
|
||||||
// Stacked interface removed notification arrives.
|
// Stacked interface removed notification arrives.
|
||||||
nat.interfaceRemoved(STACKED_IFACE);
|
nat.interfaceRemoved(STACKED_IFACE);
|
||||||
@@ -156,7 +156,7 @@ public class Nat464XlatTest {
|
|||||||
assertFalse(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE));
|
assertFalse(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE));
|
||||||
assertIdle(nat);
|
assertIdle(nat);
|
||||||
|
|
||||||
verifyNoMoreInteractions(mNms, mConnectivity);
|
verifyNoMoreInteractions(mNetd, mNms, mConnectivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -168,7 +168,7 @@ public class Nat464XlatTest {
|
|||||||
nat.start();
|
nat.start();
|
||||||
|
|
||||||
verify(mNms).registerObserver(eq(nat));
|
verify(mNms).registerObserver(eq(nat));
|
||||||
verify(mNms).startClatd(eq(BASE_IFACE));
|
verify(mNetd).clatdStart(eq(BASE_IFACE));
|
||||||
|
|
||||||
// Stacked interface up notification arrives.
|
// Stacked interface up notification arrives.
|
||||||
nat.interfaceLinkStateChanged(STACKED_IFACE, true);
|
nat.interfaceLinkStateChanged(STACKED_IFACE, true);
|
||||||
@@ -185,7 +185,7 @@ public class Nat464XlatTest {
|
|||||||
mLooper.dispatchNext();
|
mLooper.dispatchNext();
|
||||||
|
|
||||||
verify(mNms).unregisterObserver(eq(nat));
|
verify(mNms).unregisterObserver(eq(nat));
|
||||||
verify(mNms).stopClatd(eq(BASE_IFACE));
|
verify(mNetd).clatdStop(eq(BASE_IFACE));
|
||||||
verify(mConnectivity, times(2)).handleUpdateLinkProperties(eq(mNai), c.capture());
|
verify(mConnectivity, times(2)).handleUpdateLinkProperties(eq(mNai), c.capture());
|
||||||
assertTrue(c.getValue().getStackedLinks().isEmpty());
|
assertTrue(c.getValue().getStackedLinks().isEmpty());
|
||||||
assertFalse(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE));
|
assertFalse(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE));
|
||||||
@@ -194,7 +194,7 @@ public class Nat464XlatTest {
|
|||||||
// ConnectivityService stops clat: no-op.
|
// ConnectivityService stops clat: no-op.
|
||||||
nat.stop();
|
nat.stop();
|
||||||
|
|
||||||
verifyNoMoreInteractions(mNms, mConnectivity);
|
verifyNoMoreInteractions(mNetd, mNms, mConnectivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -205,13 +205,13 @@ public class Nat464XlatTest {
|
|||||||
nat.start();
|
nat.start();
|
||||||
|
|
||||||
verify(mNms).registerObserver(eq(nat));
|
verify(mNms).registerObserver(eq(nat));
|
||||||
verify(mNms).startClatd(eq(BASE_IFACE));
|
verify(mNetd).clatdStart(eq(BASE_IFACE));
|
||||||
|
|
||||||
// ConnectivityService immediately stops clat (Network disconnects, IPv4 addr appears, ...)
|
// ConnectivityService immediately stops clat (Network disconnects, IPv4 addr appears, ...)
|
||||||
nat.stop();
|
nat.stop();
|
||||||
|
|
||||||
verify(mNms).unregisterObserver(eq(nat));
|
verify(mNms).unregisterObserver(eq(nat));
|
||||||
verify(mNms).stopClatd(eq(BASE_IFACE));
|
verify(mNetd).clatdStop(eq(BASE_IFACE));
|
||||||
assertIdle(nat);
|
assertIdle(nat);
|
||||||
|
|
||||||
// In-flight interface up notification arrives: no-op
|
// In-flight interface up notification arrives: no-op
|
||||||
@@ -225,7 +225,7 @@ public class Nat464XlatTest {
|
|||||||
|
|
||||||
assertIdle(nat);
|
assertIdle(nat);
|
||||||
|
|
||||||
verifyNoMoreInteractions(mNms, mConnectivity);
|
verifyNoMoreInteractions(mNetd, mNms, mConnectivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -236,16 +236,16 @@ public class Nat464XlatTest {
|
|||||||
nat.start();
|
nat.start();
|
||||||
|
|
||||||
verify(mNms).registerObserver(eq(nat));
|
verify(mNms).registerObserver(eq(nat));
|
||||||
verify(mNms).startClatd(eq(BASE_IFACE));
|
verify(mNetd).clatdStart(eq(BASE_IFACE));
|
||||||
|
|
||||||
// ConnectivityService immediately stops clat (Network disconnects, IPv4 addr appears, ...)
|
// ConnectivityService immediately stops clat (Network disconnects, IPv4 addr appears, ...)
|
||||||
nat.stop();
|
nat.stop();
|
||||||
|
|
||||||
verify(mNms).unregisterObserver(eq(nat));
|
verify(mNms).unregisterObserver(eq(nat));
|
||||||
verify(mNms).stopClatd(eq(BASE_IFACE));
|
verify(mNetd).clatdStop(eq(BASE_IFACE));
|
||||||
assertIdle(nat);
|
assertIdle(nat);
|
||||||
|
|
||||||
verifyNoMoreInteractions(mNms, mConnectivity);
|
verifyNoMoreInteractions(mNetd, mNms, mConnectivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void assertIdle(Nat464Xlat nat) {
|
static void assertIdle(Nat464Xlat nat) {
|
||||||
|
|||||||
Reference in New Issue
Block a user