diff options
| author | 2020-03-26 06:59:16 +0000 | |
|---|---|---|
| committer | 2020-03-26 06:59:16 +0000 | |
| commit | 13ff35faab8e69ed598a79e655e98411b8041c87 (patch) | |
| tree | 5ccdb148df70240faf494c8d9bd51b29a2e1a41b | |
| parent | 6f3e64a56e33a9fd3c553a56fc0da7c40f82e918 (diff) | |
| parent | 250678109589eca69d677cb3b9cde1ff07c3dd31 (diff) | |
Merge "Update connected clients when a downstream disappears." into rvc-dev
| -rw-r--r-- | packages/Tethering/src/com/android/server/connectivity/tethering/Tethering.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/Tethering/src/com/android/server/connectivity/tethering/Tethering.java b/packages/Tethering/src/com/android/server/connectivity/tethering/Tethering.java index 3624dc708766..c84892d675f9 100644 --- a/packages/Tethering/src/com/android/server/connectivity/tethering/Tethering.java +++ b/packages/Tethering/src/com/android/server/connectivity/tethering/Tethering.java @@ -433,9 +433,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); } } @@ -1575,6 +1573,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. @@ -2157,6 +2156,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 @@ -2171,10 +2176,7 @@ public class Tethering { @Override public void dhcpLeasesChanged() { - if (mConnectedClientsTracker.updateConnectedClients( - mForwardedDownstreams, null /* wifiClients */)) { - reportTetherClientsChanged(mConnectedClientsTracker.getLastTetheredClients()); - } + updateConnectedClients(null /* wifiClients */); } }; } |