diff options
author | Paul Jensen <pauljensen@google.com> | 2015-05-05 14:56:10 -0400 |
---|---|---|
committer | Paul Jensen <pauljensen@google.com> | 2015-05-18 11:41:39 -0400 |
commit | 700f236afb373125353a304d9098557890b9253f (patch) | |
tree | a00adb6f17c87b167704a5e5ec858183aab262d7 /services/core/java/com/android/server/connectivity/NetworkMonitor.java | |
parent | d0491e9a2c51f8b16f9e11627c38278e3649ae8c (diff) | |
download | frameworks_base-700f236afb373125353a304d9098557890b9253f.zip frameworks_base-700f236afb373125353a304d9098557890b9253f.tar.gz frameworks_base-700f236afb373125353a304d9098557890b9253f.tar.bz2 |
Avoid surfacing "Sign in to network" notification if user selects "use as is"
from captive portal app.
Bug:20440795
Change-Id: I2582109008bc8659d64ead316843c15ca573b1ba
Diffstat (limited to 'services/core/java/com/android/server/connectivity/NetworkMonitor.java')
-rw-r--r-- | services/core/java/com/android/server/connectivity/NetworkMonitor.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/connectivity/NetworkMonitor.java b/services/core/java/com/android/server/connectivity/NetworkMonitor.java index 7135f35..fba9258 100644 --- a/services/core/java/com/android/server/connectivity/NetworkMonitor.java +++ b/services/core/java/com/android/server/connectivity/NetworkMonitor.java @@ -208,6 +208,8 @@ public class NetworkMonitor extends StateMachine { // Set if the user explicitly selected "Do not use this network" in captive portal sign-in app. private boolean mUserDoesNotWant = false; + // Avoids surfacing "Sign in to network" notification. + private boolean mDontDisplaySigninNotification = false; public boolean systemReady = false; @@ -299,11 +301,13 @@ public class NetworkMonitor extends StateMachine { sendMessage(CMD_FORCE_REEVALUATION, 0 /* no UID */, 0); break; case ConnectivityManager.CAPTIVE_PORTAL_APP_RETURN_WANTED_AS_IS: + mDontDisplaySigninNotification = true; // TODO: Distinguish this from a network that actually validates. // Displaying the "!" on the system UI icon may still be a good idea. transitionTo(mValidatedState); break; case ConnectivityManager.CAPTIVE_PORTAL_APP_RETURN_UNWANTED: + mDontDisplaySigninNotification = true; mUserDoesNotWant = true; mConnectivityServiceHandler.sendMessage(obtainMessage( EVENT_NETWORK_TESTED, NETWORK_TEST_RESULT_INVALID, 0, @@ -498,7 +502,7 @@ public class NetworkMonitor extends StateMachine { mConnectivityServiceHandler.sendMessage(obtainMessage(EVENT_NETWORK_TESTED, NETWORK_TEST_RESULT_INVALID, 0, mNetworkAgentInfo)); // Don't annoy user with sign-in notifications. - if (mUserDoesNotWant) return; + if (mDontDisplaySigninNotification) return; // Create a CustomIntentReceiver that sends us a // CMD_LAUNCH_CAPTIVE_PORTAL_APP message when the user // touches the notification. |