Merge "Don't send onLinkPropertiesChanged after onLost for 464xlat."
This commit is contained in:
@@ -398,10 +398,10 @@ public class UpstreamNetworkMonitor {
|
|||||||
// notifications (e.g. matching more than one of our callbacks).
|
// notifications (e.g. matching more than one of our callbacks).
|
||||||
//
|
//
|
||||||
// Also, it can happen that onLinkPropertiesChanged is called after
|
// Also, it can happen that onLinkPropertiesChanged is called after
|
||||||
// onLost removed the state from mNetworkMap. This appears to be due
|
// onLost removed the state from mNetworkMap. This is due to a bug
|
||||||
// to a bug in disconnectAndDestroyNetwork, which calls
|
// in disconnectAndDestroyNetwork, which calls nai.clatd.update()
|
||||||
// nai.clatd.update() after the onLost callbacks.
|
// after the onLost callbacks. This was fixed in S.
|
||||||
// TODO: fix the bug and make this method void.
|
// TODO: make this method void when R is no longer supported.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6299,8 +6299,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
// there may not be a strict 1:1 correlation between the two.
|
// there may not be a strict 1:1 correlation between the two.
|
||||||
private final NetIdManager mNetIdManager;
|
private final NetIdManager mNetIdManager;
|
||||||
|
|
||||||
// NetworkAgentInfo keyed off its connecting messenger
|
// Tracks all NetworkAgents that are currently registered.
|
||||||
// TODO - eval if we can reduce the number of lists/hashmaps/sparsearrays
|
|
||||||
// NOTE: Only should be accessed on ConnectivityServiceThread, except dump().
|
// NOTE: Only should be accessed on ConnectivityServiceThread, except dump().
|
||||||
private final ArraySet<NetworkAgentInfo> mNetworkAgentInfos = new ArraySet<>();
|
private final ArraySet<NetworkAgentInfo> mNetworkAgentInfos = new ArraySet<>();
|
||||||
|
|
||||||
@@ -7452,7 +7451,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
public void handleUpdateLinkProperties(NetworkAgentInfo nai, LinkProperties newLp) {
|
public void handleUpdateLinkProperties(NetworkAgentInfo nai, LinkProperties newLp) {
|
||||||
ensureRunningOnConnectivityServiceThread();
|
ensureRunningOnConnectivityServiceThread();
|
||||||
|
|
||||||
if (getNetworkAgentInfoForNetId(nai.network.getNetId()) != nai) {
|
if (!mNetworkAgentInfos.contains(nai)) {
|
||||||
// Ignore updates for disconnected networks
|
// Ignore updates for disconnected networks
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8631,13 +8631,8 @@ public class ConnectivityServiceTest {
|
|||||||
// Disconnect the network. clat is stopped and the network is destroyed.
|
// Disconnect the network. clat is stopped and the network is destroyed.
|
||||||
mCellNetworkAgent.disconnect();
|
mCellNetworkAgent.disconnect();
|
||||||
networkCallback.expectCallback(CallbackEntry.LOST, mCellNetworkAgent);
|
networkCallback.expectCallback(CallbackEntry.LOST, mCellNetworkAgent);
|
||||||
// TODO: delete this spurious onLinkPropertiesChanged callback.
|
|
||||||
networkCallback.expectLinkPropertiesThat(mCellNetworkAgent,
|
|
||||||
lp -> lp.getStackedLinks().isEmpty());
|
|
||||||
networkCallback.assertNoCallback();
|
networkCallback.assertNoCallback();
|
||||||
verify(mMockNetd).clatdStop(MOBILE_IFNAME);
|
verify(mMockNetd).clatdStop(MOBILE_IFNAME);
|
||||||
verify(mMockNetd).networkRemoveInterface(cellNetId, CLAT_MOBILE_IFNAME);
|
|
||||||
assertRoutesRemoved(cellNetId, stackedDefault);
|
|
||||||
verify(mMockNetd).idletimerRemoveInterface(eq(MOBILE_IFNAME), anyInt(),
|
verify(mMockNetd).idletimerRemoveInterface(eq(MOBILE_IFNAME), anyInt(),
|
||||||
eq(Integer.toString(TRANSPORT_CELLULAR)));
|
eq(Integer.toString(TRANSPORT_CELLULAR)));
|
||||||
verify(mMockNetd).networkDestroy(cellNetId);
|
verify(mMockNetd).networkDestroy(cellNetId);
|
||||||
|
|||||||
Reference in New Issue
Block a user