diff options
author | Michael Plass <mplass@google.com> | 2019-05-10 15:12:03 -0700 |
---|---|---|
committer | Michael Plass <mplass@google.com> | 2019-05-13 13:09:15 -0700 |
commit | bb7edf7945cc575f4a42ac6820c3a4da3e0eaf49 (patch) | |
tree | 9eaa1d89a3daa583502c05cbc16e756e5156e78e | |
parent | b70a500802ff55d13c71f7431e0c32d0220e9d04 (diff) |
Do not disconnect wifi immediately due to no internet
Setting DISABLED_NO_INTERNET_PERMANENT status does not need to disconnect.
Bug: 130766237
Test: atest FrameworksWifiTests
Change-Id: Ic8d04447044caf076d7981cf7254c3c016cb1d02
-rw-r--r-- | service/java/com/android/server/wifi/WifiConnectivityManager.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiConnectivityManager.java b/service/java/com/android/server/wifi/WifiConnectivityManager.java index 7d34e405d..7411422e0 100644 --- a/service/java/com/android/server/wifi/WifiConnectivityManager.java +++ b/service/java/com/android/server/wifi/WifiConnectivityManager.java @@ -16,6 +16,7 @@ package com.android.server.wifi; +import static android.net.wifi.WifiConfiguration.NetworkSelectionStatus.DISABLED_NO_INTERNET_PERMANENT; import static android.net.wifi.WifiConfiguration.NetworkSelectionStatus.DISABLED_NO_INTERNET_TEMPORARY; import static com.android.internal.util.Preconditions.checkNotNull; @@ -565,6 +566,11 @@ public class WifiConnectivityManager { } @Override public void onSavedNetworkPermanentlyDisabled(int networkId, int disableReason) { + // For DISABLED_NO_INTERNET_PERMANENT we do not need to remove the network + // because supplicant won't be trying to reconnect. If this is due to a + // preventAutomaticReconnect request from ConnectivityService, that service + // will disconnect as appropriate. + if (disableReason == DISABLED_NO_INTERNET_PERMANENT) return; mConnectivityHelper.removeNetworkIfCurrent(networkId); updatePnoScan(); } |