summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlucaslin <lucaslin@google.com>2019-04-08 15:47:25 +0800
committerlucaslin <lucaslin@google.com>2019-04-08 15:47:25 +0800
commit0c8387ce9faf18e433ac8c8c354eaea176a26c91 (patch)
tree407ad53023fcbf2e4c64c2a789c00d5723aed147 /src
parentfb5e4e2035f20464fa199b1ae8ba5d9f0cda4666 (diff)
Prevent SIGN_IN notification pop up several times
SIGN_IN notification may pop up several times before user logged in the network if someone trigger ConnectivityService#reportNetworkConnectivity(). Add a boolean to make sure SIGN_IN notification will only pop up once to user before user logged in. Bug: b/122164725 Test: Build pass. Change-Id: I9c7f1d47fde8e5dfadd6646497023b05f3b0ed88 Merged-In: I9c7f1d47fde8e5dfadd6646497023b05f3b0ed88
Diffstat (limited to 'src')
-rw-r--r--src/com/android/server/connectivity/NetworkMonitor.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/server/connectivity/NetworkMonitor.java b/src/com/android/server/connectivity/NetworkMonitor.java
index 6f31f9b..8f7d988 100644
--- a/src/com/android/server/connectivity/NetworkMonitor.java
+++ b/src/com/android/server/connectivity/NetworkMonitor.java
@@ -779,6 +779,7 @@ public class NetworkMonitor extends StateMachine {
@Override
public void exit() {
+ mLaunchCaptivePortalAppBroadcastReceiver = null;
hideProvisioningNotification();
}
}
@@ -902,9 +903,10 @@ public class NetworkMonitor extends StateMachine {
mLaunchCaptivePortalAppBroadcastReceiver = new CustomIntentReceiver(
ACTION_LAUNCH_CAPTIVE_PORTAL_APP, new Random().nextInt(),
CMD_LAUNCH_CAPTIVE_PORTAL_APP);
+ // Display the sign in notification.
+ // Only do this once for every time we enter MaybeNotifyState. b/122164725
+ showProvisioningNotification(mLaunchCaptivePortalAppBroadcastReceiver.mAction);
}
- // Display the sign in notification.
- showProvisioningNotification(mLaunchCaptivePortalAppBroadcastReceiver.mAction);
// Retest for captive portal occasionally.
sendMessageDelayed(CMD_CAPTIVE_PORTAL_RECHECK, 0 /* no UID */,
CAPTIVE_PORTAL_REEVALUATE_DELAY_MS);