Merge "API to get network visible network capability name" am: aac4d3242a am: 238cd3344e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653200 Change-Id: Ia6c65d6cd6d322d5599942ec65323a0d62e4dd1b
This commit is contained in:
@@ -273,6 +273,7 @@ package android.net {
|
||||
|
||||
public final class NetworkCapabilities implements android.os.Parcelable {
|
||||
method @NonNull public int[] getAdministratorUids();
|
||||
method @Nullable public static String getCapabilityCarrierName(int);
|
||||
method @Nullable public String getSsid();
|
||||
method @NonNull public int[] getTransportTypes();
|
||||
method public boolean isPrivateDnsBroken();
|
||||
|
||||
@@ -728,6 +728,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