Update connected clients when a downstream disappears.
Otherwise, if another downstream of the same type reappears, the code would fire a callback with the previous list of clients. Bug: 150644681 Test: atest TetheringIntegrationTests:EthernetTetheringTest --rerun-until-failure 100 Change-Id: I6b34ea747ae1831001077f44879bb6828dcecc96
This commit is contained in:
@@ -430,9 +430,7 @@ public class Tethering {
|
|||||||
// Called by wifi when the number of soft AP clients changed.
|
// Called by wifi when the number of soft AP clients changed.
|
||||||
@Override
|
@Override
|
||||||
public void onConnectedClientsChanged(final List<WifiClient> clients) {
|
public void onConnectedClientsChanged(final List<WifiClient> clients) {
|
||||||
if (mConnectedClientsTracker.updateConnectedClients(mForwardedDownstreams, clients)) {
|
updateConnectedClients(clients);
|
||||||
reportTetherClientsChanged(mConnectedClientsTracker.getLastTetheredClients());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1558,6 +1556,7 @@ public class Tethering {
|
|||||||
mIPv6TetheringCoordinator.removeActiveDownstream(who);
|
mIPv6TetheringCoordinator.removeActiveDownstream(who);
|
||||||
mOffload.excludeDownstreamInterface(who.interfaceName());
|
mOffload.excludeDownstreamInterface(who.interfaceName());
|
||||||
mForwardedDownstreams.remove(who);
|
mForwardedDownstreams.remove(who);
|
||||||
|
updateConnectedClients(null /* wifiClients */);
|
||||||
|
|
||||||
// If this is a Wi-Fi interface, tell WifiManager of any errors
|
// If this is a Wi-Fi interface, tell WifiManager of any errors
|
||||||
// or the inactive serving state.
|
// or the inactive serving state.
|
||||||
@@ -2140,6 +2139,12 @@ public class Tethering {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateConnectedClients(final List<WifiClient> wifiClients) {
|
||||||
|
if (mConnectedClientsTracker.updateConnectedClients(mForwardedDownstreams, wifiClients)) {
|
||||||
|
reportTetherClientsChanged(mConnectedClientsTracker.getLastTetheredClients());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private IpServer.Callback makeControlCallback() {
|
private IpServer.Callback makeControlCallback() {
|
||||||
return new IpServer.Callback() {
|
return new IpServer.Callback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -2154,10 +2159,7 @@ public class Tethering {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dhcpLeasesChanged() {
|
public void dhcpLeasesChanged() {
|
||||||
if (mConnectedClientsTracker.updateConnectedClients(
|
updateConnectedClients(null /* wifiClients */);
|
||||||
mForwardedDownstreams, null /* wifiClients */)) {
|
|
||||||
reportTetherClientsChanged(mConnectedClientsTracker.getLastTetheredClients());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user