Skip to content
Commit a173a63a authored by Hugo Benichi's avatar Hugo Benichi
Browse files

CaptivePortalLogin correctly unregisters callbacks

The NetworkCallback registered by the CaptivePortalLogin activity in
onCreate was unregistered in both onDestroy() and done(). In addition
done() can be called concurrently from different places (from the
webview, from the captive portal test probe, from the activity menu),
resulting in incorrectly unregistering the callback more than once.

This patch fixes the lifecycle management of the NetworkCallback
registered by the CaptivePortalLogin activity so that it is unregistered
once only in onDestroy.

In addition the done() method is made robust against multiple calls and
becomes a no-op after the first call. This avoids multiple calls
to CaptivePortal for the same captive portal.

Bug: 62497809
Test: tested manually with captive portal setup in the office
Change-Id: Ib5da2bd9276d4bd202f1045315b3849f67a15078

(cherry pick from commit 605b2950)
parent f7f48b17
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment