From 3ea09e080a9ab3ed594356d8f3e498ec61a4d0fb Mon Sep 17 00:00:00 2001 From: Jack Tian Date: Thu, 2 Jun 2016 14:16:58 -0700 Subject: DO NOT MERGE: Repeatedly prompting when no internet connection When internet connection is not avaiable there is always a prompt even if user has checked "never ask again" on the dialog prompt. This is caused by noInternetAccessExpected reset while reloading network configuration and this patch puts noInternetAccessExpected into network history so that its value is not lost. Bug: 29085788 Bug: 29111340 (cherry picked from commit 4854de88e57279bf930f0754b268093061e88544) Change-Id: I407a5c60e89d7da4ac7fe30df08087fe24039f98 --- service/java/com/android/server/wifi/WifiNetworkHistory.java | 6 ++++++ service/java/com/android/server/wifi/WifiStateMachine.java | 1 + 2 files changed, 7 insertions(+) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiNetworkHistory.java b/service/java/com/android/server/wifi/WifiNetworkHistory.java index cd1fe8b21..380b768c9 100644 --- a/service/java/com/android/server/wifi/WifiNetworkHistory.java +++ b/service/java/com/android/server/wifi/WifiNetworkHistory.java @@ -87,6 +87,7 @@ public class WifiNetworkHistory { private static final String SCORER_OVERRIDE_AND_SWITCH_KEY = "SCORER_OVERRIDE_AND_SWITCH"; private static final String VALIDATED_INTERNET_ACCESS_KEY = "VALIDATED_INTERNET_ACCESS"; private static final String NO_INTERNET_ACCESS_REPORTS_KEY = "NO_INTERNET_ACCESS_REPORTS"; + private static final String NO_INTERNET_ACCESS_EXPECTED_KEY = "NO_INTERNET_ACCESS_EXPECTED"; private static final String EPHEMERAL_KEY = "EPHEMERAL"; private static final String USE_EXTERNAL_SCORES_KEY = "USE_EXTERNAL_SCORES"; private static final String METERED_HINT_KEY = "METERED_HINT"; @@ -208,6 +209,8 @@ public class WifiNetworkHistory { + Integer.toString(config.numNoInternetAccessReports) + NL); out.writeUTF(VALIDATED_INTERNET_ACCESS_KEY + SEPARATOR + Boolean.toString(config.validatedInternetAccess) + NL); + out.writeUTF(NO_INTERNET_ACCESS_EXPECTED_KEY + SEPARATOR + + Boolean.toString(config.noInternetAccessExpected) + NL); out.writeUTF(EPHEMERAL_KEY + SEPARATOR + Boolean.toString(config.ephemeral) + NL); out.writeUTF(METERED_HINT_KEY + SEPARATOR @@ -412,6 +415,9 @@ public class WifiNetworkHistory { case VALIDATED_INTERNET_ACCESS_KEY: config.validatedInternetAccess = Boolean.parseBoolean(value); break; + case NO_INTERNET_ACCESS_EXPECTED_KEY: + config.noInternetAccessExpected = Boolean.parseBoolean(value); + break; case CREATION_TIME_KEY: config.creationTime = value; break; diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 2181311bc..29e551ca4 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -7091,6 +7091,7 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss config = getCurrentWifiConfiguration(); if (config != null) { config.noInternetAccessExpected = accept; + mWifiConfigManager.writeKnownNetworkHistory(); } return HANDLED; case CMD_TEST_NETWORK_DISCONNECT: -- cgit v1.2.3