Rename satisfiedBy into canBeSatisfiedBy
Test: FrameworksNetTests NetworkStackTests Bug: 152238712 Change-Id: I076876a6662bde143ef7d315ce3767acafff93c1
This commit is contained in:
@@ -1122,7 +1122,7 @@ public final class NetworkCapabilities implements Parcelable {
|
||||
}
|
||||
|
||||
private boolean satisfiedBySpecifier(NetworkCapabilities nc) {
|
||||
return mNetworkSpecifier == null || mNetworkSpecifier.satisfiedBy(nc.mNetworkSpecifier)
|
||||
return mNetworkSpecifier == null || mNetworkSpecifier.canBeSatisfiedBy(nc.mNetworkSpecifier)
|
||||
|| nc.mNetworkSpecifier instanceof MatchAllNetworkSpecifier;
|
||||
}
|
||||
|
||||
|
||||
@@ -474,7 +474,7 @@ public class NetworkRequest implements Parcelable {
|
||||
* @param nc Capabilities that should satisfy this NetworkRequest. null capabilities do not
|
||||
* satisfy any request.
|
||||
*/
|
||||
public boolean satisfiedBy(@Nullable NetworkCapabilities nc) {
|
||||
public boolean canBeSatisfiedBy(@Nullable NetworkCapabilities nc) {
|
||||
return networkCapabilities.satisfiedByNetworkCapabilities(nc);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,9 @@ public abstract class NetworkSpecifier {
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public abstract boolean satisfiedBy(@Nullable NetworkSpecifier other);
|
||||
public boolean canBeSatisfiedBy(@Nullable NetworkSpecifier other) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method which can be overridden by concrete implementations of NetworkSpecifier to
|
||||
|
||||
@@ -40,7 +40,7 @@ public final class StringNetworkSpecifier extends NetworkSpecifier implements Pa
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public boolean satisfiedBy(NetworkSpecifier other) {
|
||||
public boolean canBeSatisfiedBy(NetworkSpecifier other) {
|
||||
return equals(other);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ public final class TelephonyNetworkSpecifier extends NetworkSpecifier implements
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public boolean satisfiedBy(NetworkSpecifier other) {
|
||||
public boolean canBeSatisfiedBy(NetworkSpecifier other) {
|
||||
// Any generic requests should be satisfied by a specific telephony network.
|
||||
// For simplicity, we treat null same as MatchAllNetworkSpecifier
|
||||
return equals(other) || other == null || other instanceof MatchAllNetworkSpecifier;
|
||||
|
||||
Reference in New Issue
Block a user