am f5118c89: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev

* commit 'f5118c89e004156082966518f379c8ac7e065d7f':
  Don't mark NetworkRequests restricted when they don't have restricted caps
This commit is contained in:
Paul Jensen
2015-09-23 11:13:48 +00:00
committed by Android Git Automerger

View File

@@ -281,8 +281,12 @@ public final class NetworkCapabilities implements Parcelable {
public void maybeMarkCapabilitiesRestricted() { public void maybeMarkCapabilitiesRestricted() {
// If all the capabilities are typically provided by restricted networks, conclude that this // If all the capabilities are typically provided by restricted networks, conclude that this
// network is restricted. // 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); removeCapability(NET_CAPABILITY_NOT_RESTRICTED);
}
} }
/** /**