Merge "Prevent SIGN_IN notification pop up several times"

This commit is contained in:
Lucas Lin
2019-04-08 04:37:47 +00:00
committed by Gerrit Code Review

View File

@@ -779,6 +779,7 @@ public class NetworkMonitor extends StateMachine {
@Override @Override
public void exit() { public void exit() {
mLaunchCaptivePortalAppBroadcastReceiver = null;
hideProvisioningNotification(); hideProvisioningNotification();
} }
} }
@@ -902,9 +903,10 @@ public class NetworkMonitor extends StateMachine {
mLaunchCaptivePortalAppBroadcastReceiver = new CustomIntentReceiver( mLaunchCaptivePortalAppBroadcastReceiver = new CustomIntentReceiver(
ACTION_LAUNCH_CAPTIVE_PORTAL_APP, new Random().nextInt(), ACTION_LAUNCH_CAPTIVE_PORTAL_APP, new Random().nextInt(),
CMD_LAUNCH_CAPTIVE_PORTAL_APP); 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. // Retest for captive portal occasionally.
sendMessageDelayed(CMD_CAPTIVE_PORTAL_RECHECK, 0 /* no UID */, sendMessageDelayed(CMD_CAPTIVE_PORTAL_RECHECK, 0 /* no UID */,
CAPTIVE_PORTAL_REEVALUATE_DELAY_MS); CAPTIVE_PORTAL_REEVALUATE_DELAY_MS);