diff options
| author | 2019-04-08 10:52:46 +0800 | |
|---|---|---|
| committer | 2019-04-08 10:52:46 +0800 | |
| commit | 04e50f8608fec0149f412db85b13a33ca3deba89 (patch) | |
| tree | 4c6044034824e9159fb494433530083696d07ff1 | |
| parent | f9d61f1c6dd0f797ca5286495503b45d4b83cbd7 (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
| -rw-r--r-- | packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java b/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java index c000fc6b721d..969a6a0219aa 100644 --- a/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java +++ b/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java @@ -790,6 +790,7 @@ public class NetworkMonitor extends StateMachine { @Override public void exit() { + mLaunchCaptivePortalAppBroadcastReceiver = null; hideProvisioningNotification(); } } @@ -913,9 +914,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); |