diff options
| author | Paul Jensen <pauljensen@google.com> | 2015-09-23 11:13:48 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-23 11:13:48 +0000 |
| commit | 773d71e7c45d12810267bb24735360da6e5b258d (patch) | |
| tree | f2e71b2ab0b42a40a818ede1a29d176e1ef831b8 /core/java | |
| parent | 96cd7c14b5e4a82727f7b56bbdf6cfafda0f17b6 (diff) | |
| parent | 962c3a0f2dd46d55ea591671c0a90c1c40214af7 (diff) | |
| download | frameworks_base-773d71e7c45d12810267bb24735360da6e5b258d.zip frameworks_base-773d71e7c45d12810267bb24735360da6e5b258d.tar.gz frameworks_base-773d71e7c45d12810267bb24735360da6e5b258d.tar.bz2 | |
am 962c3a0f: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit '962c3a0f2dd46d55ea591671c0a90c1c40214af7':
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.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/net/NetworkCapabilities.java b/core/java/android/net/NetworkCapabilities.java index 76c24ba..0720885 100644 --- a/core/java/android/net/NetworkCapabilities.java +++ b/core/java/android/net/NetworkCapabilities.java @@ -281,8 +281,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); + } } /** |
