From 95eae9f3e621d3bd5f9b0b63b4c464533b4ba8cd Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 18 May 2018 17:06:40 -0700 Subject: WifiStateMachine: Re-enable network on internet validation Once the network has validated internet access, re-enable network selection status to clear out any blacklist. This will handle cases where the network had no-internet temporarily and then re-established internet connectivity. Also, added an explicit log when network is being disabled because of no-internet. Bug: 72635747 Test: Unit tests Test: Manually verified that network was re-enabled when internet connectivity was restored (when there were no other saved networks around) Change-Id: I0de3c0e8c842efe56b1ab0fd2fb89bd2874e7285 --- service/java/com/android/server/wifi/WifiStateMachine.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index fa22749bb..ef5eb027f 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -5300,6 +5300,8 @@ public class WifiStateMachine extends StateMachine { // selection status to temporarily disable the network. if (mWifiConfigManager.getLastSelectedNetwork() != config.networkId && !config.noInternetAccessExpected) { + Log.i(TAG, "Temporarily disabling network because of" + + "no-internet access"); mWifiConfigManager.updateNetworkSelectionStatus( config.networkId, WifiConfiguration.NetworkSelectionStatus @@ -5314,6 +5316,10 @@ public class WifiStateMachine extends StateMachine { config = getCurrentWifiConfiguration(); if (config != null) { // re-enable autojoin + mWifiConfigManager.updateNetworkSelectionStatus( + config.networkId, + WifiConfiguration.NetworkSelectionStatus + .NETWORK_SELECTION_ENABLE); mWifiConfigManager.setNetworkValidatedInternetAccess( config.networkId, true); } -- cgit v1.2.3