summaryrefslogtreecommitdiffstats
path: root/services/tests
diff options
context:
space:
mode:
authorPaul Jensen <pauljensen@google.com>2015-08-05 10:03:47 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-08-05 10:03:47 +0000
commitdbc4edccfced5cb739bae75e8cd15cecc39cf16e (patch)
tree779ba61d20fff87f12eff466d9774b734e78b607 /services/tests
parent519adb50ebd45b8ecd1a8b8abbb975e35bb42974 (diff)
parent487ffe7d3d84bf65212158f7098e8a84b5b55e09 (diff)
downloadframeworks_base-dbc4edccfced5cb739bae75e8cd15cecc39cf16e.zip
frameworks_base-dbc4edccfced5cb739bae75e8cd15cecc39cf16e.tar.gz
frameworks_base-dbc4edccfced5cb739bae75e8cd15cecc39cf16e.tar.bz2
Merge "Fix NOT_RESTRICTED network capability and enforce it." into mnc-dev
Diffstat (limited to 'services/tests')
-rw-r--r--services/tests/servicestests/src/com/android/server/ConnectivityServiceTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/tests/servicestests/src/com/android/server/ConnectivityServiceTest.java b/services/tests/servicestests/src/com/android/server/ConnectivityServiceTest.java
index 19d29f3..696f106 100644
--- a/services/tests/servicestests/src/com/android/server/ConnectivityServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/ConnectivityServiceTest.java
@@ -937,6 +937,19 @@ public class ConnectivityServiceTest extends AndroidTestCase {
}
private void tryNetworkFactoryRequests(int capability) throws Exception {
+ // Verify NOT_RESTRICTED is set appropriately
+ final NetworkCapabilities nc = new NetworkRequest.Builder().addCapability(capability)
+ .build().networkCapabilities;
+ if (capability == NET_CAPABILITY_CBS || capability == NET_CAPABILITY_DUN ||
+ capability == NET_CAPABILITY_EIMS || capability == NET_CAPABILITY_FOTA ||
+ capability == NET_CAPABILITY_IA || capability == NET_CAPABILITY_IMS ||
+ capability == NET_CAPABILITY_RCS || capability == NET_CAPABILITY_XCAP ||
+ capability == NET_CAPABILITY_TRUSTED || capability == NET_CAPABILITY_NOT_VPN) {
+ assertFalse(nc.hasCapability(NET_CAPABILITY_NOT_RESTRICTED));
+ } else {
+ assertTrue(nc.hasCapability(NET_CAPABILITY_NOT_RESTRICTED));
+ }
+
NetworkCapabilities filter = new NetworkCapabilities();
filter.addCapability(capability);
final HandlerThread handlerThread = new HandlerThread("testNetworkFactoryRequests");