summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hugo Benichi <hugobenichi@google.com> 2017-05-18 05:39:24 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-05-18 05:39:31 +0000
commit1fe60b213e464c649784124e2932435aa353a78d (patch)
tree389e48dda1b8345eb2017b6030a387fe2a148e85
parentb114e4ff82ba0b4d2d684d8dfbcb7f7e4a1f8d8d (diff)
parent483d12e42696cd38abba0bbe2141b212db11e44a (diff)
Merge "Captive portals: reinspect http result after fallback probe" into oc-dev
-rw-r--r--services/core/java/com/android/server/connectivity/NetworkMonitor.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/connectivity/NetworkMonitor.java b/services/core/java/com/android/server/connectivity/NetworkMonitor.java
index 96f6f2d82c4c..11296aba8451 100644
--- a/services/core/java/com/android/server/connectivity/NetworkMonitor.java
+++ b/services/core/java/com/android/server/connectivity/NetworkMonitor.java
@@ -960,14 +960,18 @@ public class NetworkMonitor extends StateMachine {
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) {