API to get network visible network capability name
Test: atest DataConnectionTest, DcTrackerTest Bug: 181916712 CTS-Coverage-Bug: 183553812 Change-Id: Iae63ac4d62641cee2bd0f0c5f50dd729750d514c Merged-In: Iae63ac4d62641cee2bd0f0c5f50dd729750d514c
This commit is contained in:
@@ -749,6 +749,23 @@ public final class NetworkCapabilities implements Parcelable {
|
||||
return ((mNetworkCapabilities & CONNECTIVITY_MANAGED_CAPABILITIES) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the given capability that carriers use.
|
||||
* If the capability does not have a carrier-name, returns null.
|
||||
*
|
||||
* @param capability The capability to get the carrier-name of.
|
||||
* @return The carrier-name of the capability, or null if it doesn't exist.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static @Nullable String getCapabilityCarrierName(@NetCapability int capability) {
|
||||
if (capability == NET_CAPABILITY_ENTERPRISE) {
|
||||
return capabilityNameOf(capability);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void combineNetCapabilities(@NonNull NetworkCapabilities nc) {
|
||||
final long wantedCaps = this.mNetworkCapabilities | nc.mNetworkCapabilities;
|
||||
final long unwantedCaps =
|
||||
|
||||
Reference in New Issue
Block a user