summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorPaul Jensen <pauljensen@google.com>2015-09-23 11:06:32 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-23 11:06:32 +0000
commit962c3a0f2dd46d55ea591671c0a90c1c40214af7 (patch)
treed3cc2387fe48bbe06207c92f74473b4d98b99669 /core/java
parent635f871132449bea7489f6a61276979beeee5591 (diff)
parentece4ac2105d18d8d7b6296d6de3fdd5641c35258 (diff)
downloadframeworks_base-962c3a0f2dd46d55ea591671c0a90c1c40214af7.zip
frameworks_base-962c3a0f2dd46d55ea591671c0a90c1c40214af7.tar.gz
frameworks_base-962c3a0f2dd46d55ea591671c0a90c1c40214af7.tar.bz2
am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit 'ece4ac2105d18d8d7b6296d6de3fdd5641c35258': Don't mark NetworkRequests restricted when they don't have restricted caps
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/net/NetworkCapabilities.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/net/NetworkCapabilities.java b/core/java/android/net/NetworkCapabilities.java
index eac8926..f4e95c1 100644
--- a/core/java/android/net/NetworkCapabilities.java
+++ b/core/java/android/net/NetworkCapabilities.java
@@ -273,8 +273,12 @@ public final class NetworkCapabilities implements Parcelable {
public void maybeMarkCapabilitiesRestricted() {
// If all the capabilities are typically provided by restricted networks, conclude that this
// network is restricted.
- if ((mNetworkCapabilities & ~(DEFAULT_CAPABILITIES | RESTRICTED_CAPABILITIES)) == 0)
+ if ((mNetworkCapabilities & ~(DEFAULT_CAPABILITIES | RESTRICTED_CAPABILITIES)) == 0 &&
+ // Must have at least some restricted capabilities, otherwise a request for an
+ // internet-less network will get marked restricted.
+ (mNetworkCapabilities & RESTRICTED_CAPABILITIES) != 0) {
removeCapability(NET_CAPABILITY_NOT_RESTRICTED);
+ }
}
/**