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.
|
||||
@Override
|
||||
public void onConnectedClientsChanged(final List<WifiClient> clients) {
|
||||
if (mConnectedClientsTracker.updateConnectedClients(mForwardedDownstreams, clients)) {
|
||||
reportTetherClientsChanged(mConnectedClientsTracker.getLastTetheredClients());
|
||||
}
|
||||
updateConnectedClients(clients);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1558,6 +1556,7 @@ public class Tethering {
|
||||
mIPv6TetheringCoordinator.removeActiveDownstream(who);
|
||||
mOffload.excludeDownstreamInterface(who.interfaceName());
|
||||
mForwardedDownstreams.remove(who);
|
||||
updateConnectedClients(null /* wifiClients */);
|
||||
|
||||
// If this is a Wi-Fi interface, tell WifiManager of any errors
|
||||
// or the inactive serving state.
|
||||
@@ -2140,6 +2139,12 @@ public class Tethering {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void updateConnectedClients(final List<WifiClient> wifiClients) {
|
||||
if (mConnectedClientsTracker.updateConnectedClients(mForwardedDownstreams, wifiClients)) {
|
||||
reportTetherClientsChanged(mConnectedClientsTracker.getLastTetheredClients());
|
||||
}
|
||||
}
|
||||
|
||||
private IpServer.Callback makeControlCallback() {
|
||||
return new IpServer.Callback() {
|
||||
@Override
|
||||
@@ -2154,10 +2159,7 @@ public class Tethering {
|
||||
|
||||
@Override
|
||||
public void dhcpLeasesChanged() {
|
||||
if (mConnectedClientsTracker.updateConnectedClients(
|
||||
mForwardedDownstreams, null /* wifiClients */)) {
|
||||
reportTetherClientsChanged(mConnectedClientsTracker.getLastTetheredClients());
|
||||
}
|
||||
updateConnectedClients(null /* wifiClients */);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user