When DNS queries that precede the http and https probe take a long time
to complete, it is possible that the fallback probe fires earlier than
either the http and https probes.
This causes the detection logic to ignore the result of the http probe,
which may cause the system to miss captive portals advertising
themselves on the url used by the http probe but not on the url used by
the fallback probe.
This patch fixes that issue by forcing the detection to wait on the
result of the http probe if the fallback probe does not find a portal.
Bug:
38259299
Bug:
36532213
Test: manually tested with nearby captive portal networks
Merged-In: I07ea23a2b5f694c5ada9633169af98409efedff1
Change-Id: Ie016cad52719d07167acf026f738d31000c78cd2
(cherry picked from commit
fc47442b31761e64e188c51c3dd2a782ecbd9c62)
return result;
}
}
- // Otherwise wait until https probe completes and use its result.
+ // Otherwise wait until http and https probes completes and use their results.
try {
+ httpProbe.join();
+ if (httpProbe.result().isPortal()) {
+ return httpProbe.result();
+ }
httpsProbe.join();
+ return httpsProbe.result();
} catch (InterruptedException e) {
- validationLog("Error: https probe wait interrupted!");
+ validationLog("Error: http or https probe wait interrupted!");
return CaptivePortalProbeResult.FAILED;
}
- return httpsProbe.result();
}
private URL makeURL(String url) {