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

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

View File

@@ -281,9 +281,13 @@ 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);
}
}
/**
* Representing the transport type. Apps should generally not care about transport. A