Rename satisfiedBy into canBeSatisfiedBy

Test: FrameworksNetTests NetworkStackTests
Bug: 152238712
Change-Id: I076876a6662bde143ef7d315ce3767acafff93c1
This commit is contained in:
Chalard Jean
2020-03-27 17:57:34 +09:00
parent b0e1e7ec3e
commit 2da4f9f9ae
15 changed files with 49 additions and 57 deletions

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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;