Fixing comments in Network Capabilities
Clean up after aosp/606338 Test: m -j (only comments has been changed) Change-Id: I2627654450244024c2be92f9067534dfc2a80891
This commit is contained in:
@@ -381,7 +381,7 @@ public final class NetworkCapabilities implements Parcelable {
|
||||
/**
|
||||
* Removes (if found) the given capability from this {@code NetworkCapability} instance.
|
||||
* <p>
|
||||
* Note that this method removes capabilities that was added via {@link #addCapability(int)},
|
||||
* Note that this method removes capabilities that were added via {@link #addCapability(int)},
|
||||
* {@link #addUnwantedCapability(int)} or {@link #setCapabilities(int[], int[])} .
|
||||
*
|
||||
* @param capability the capability to be removed.
|
||||
@@ -470,6 +470,7 @@ public final class NetworkCapabilities implements Parcelable {
|
||||
&& ((mUnwantedNetworkCapabilities & (1 << capability)) != 0);
|
||||
}
|
||||
|
||||
/** Note this method may result in having the same capability in wanted and unwanted lists. */
|
||||
private void combineNetCapabilities(NetworkCapabilities nc) {
|
||||
this.mNetworkCapabilities |= nc.mNetworkCapabilities;
|
||||
this.mUnwantedNetworkCapabilities |= nc.mUnwantedNetworkCapabilities;
|
||||
@@ -1131,7 +1132,11 @@ public final class NetworkCapabilities implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Combine a set of Capabilities to this one. Useful for coming up with the complete set
|
||||
* Combine a set of Capabilities to this one. Useful for coming up with the complete set.
|
||||
* <p>
|
||||
* Note that this method may break an invariant of having a particular capability in either
|
||||
* wanted or unwanted lists but never in both. Requests that have the same capability in
|
||||
* both lists will never be satisfied.
|
||||
* @hide
|
||||
*/
|
||||
public void combineCapabilities(NetworkCapabilities nc) {
|
||||
|
||||
@@ -291,7 +291,7 @@ public class NetworkCapabilitiesTest {
|
||||
assertTrue("Request: " + request + ", Network:" + network,
|
||||
request.satisfiedByNetworkCapabilities(network));
|
||||
|
||||
// Adding capabilities that doesn't exist in the network anyway
|
||||
// Requesting absence of capabilities that network doesn't have. Request should satisfy.
|
||||
request.addUnwantedCapability(NET_CAPABILITY_WIFI_P2P);
|
||||
request.addUnwantedCapability(NET_CAPABILITY_NOT_METERED);
|
||||
assertTrue(request.satisfiedByNetworkCapabilities(network));
|
||||
@@ -306,7 +306,6 @@ public class NetworkCapabilitiesTest {
|
||||
assertTrue(request.hasUnwantedCapability(NET_CAPABILITY_NOT_RESTRICTED));
|
||||
assertFalse(request.hasCapability(NET_CAPABILITY_NOT_RESTRICTED));
|
||||
|
||||
|
||||
// Now this request won't be satisfied because network contains NOT_RESTRICTED.
|
||||
assertFalse(request.satisfiedByNetworkCapabilities(network));
|
||||
network.removeCapability(NET_CAPABILITY_NOT_RESTRICTED);
|
||||
|
||||
Reference in New Issue
Block a user