summaryrefslogtreecommitdiffstats
path: root/core/java/android/net
diff options
context:
space:
mode:
authorPaul Jensen <pauljensen@google.com>2015-07-01 14:16:32 -0400
committerPaul Jensen <pauljensen@google.com>2015-07-28 12:19:32 -0400
commitcf4c2c637268b1a2979e20a8b5644916777a02a4 (patch)
tree7717494edf7bda82adfd3215cfec34b7552e9693 /core/java/android/net
parent532737df65330200dc55ae42d31140d19c4024be (diff)
downloadframeworks_base-cf4c2c637268b1a2979e20a8b5644916777a02a4.zip
frameworks_base-cf4c2c637268b1a2979e20a8b5644916777a02a4.tar.gz
frameworks_base-cf4c2c637268b1a2979e20a8b5644916777a02a4.tar.bz2
Fix missing onLost NetworkCallbacks when network loses capability
If a network no longer satisfies a NetworkRequest, send the onLost NetworkCallback. If it was a real request (not listen) then update the NetworkFactories. To test this change I created a little infrastructure to fake different Internet connectivity probe results during tests. This allowed me to rewrite some of ConnectivityServiceTest's logic for validating networks. This brought to light a couple issues that I had to address to keep tests passing: 1. testUnlingeringDoesNotValidate was relying on a bad side-effect of my old method of ConnectivityServiceTest's logic for validating networks, so I rewrote the test. 2. ConnectivityService was not sending out NetworkCallbacks for WiFi when Cellular was validated. I'm including a fix for this in this CL also. Bug:22220234 Change-Id: I29314f38189817f8b2561a213c4f9e8522696663
Diffstat (limited to 'core/java/android/net')
-rw-r--r--core/java/android/net/NetworkCapabilities.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/java/android/net/NetworkCapabilities.java b/core/java/android/net/NetworkCapabilities.java
index 514d24a..651fb35 100644
--- a/core/java/android/net/NetworkCapabilities.java
+++ b/core/java/android/net/NetworkCapabilities.java
@@ -626,6 +626,7 @@ public final class NetworkCapabilities implements Parcelable {
case NET_CAPABILITY_TRUSTED: capabilities += "TRUSTED"; break;
case NET_CAPABILITY_NOT_VPN: capabilities += "NOT_VPN"; break;
case NET_CAPABILITY_VALIDATED: capabilities += "VALIDATED"; break;
+ case NET_CAPABILITY_CAPTIVE_PORTAL: capabilities += "CAPTIVE_PORTAL"; break;
}
if (++i < types.length) capabilities += "&";
}