Expose internal representation of transport types.

Add getTransportTypesInternal as a hidden api for internal callers. This
will be used for any metrics that need to store the transport types of a
network.

Bug: 273451360
Test: atest FrameworksNetTests
Change-Id: I527638e5408e7971a450135345e7e51b6125d665
This commit is contained in:
Hansen Kurli
2023-04-26 13:09:35 +00:00
parent c25133a38b
commit 13189e957d

View File

@@ -1347,6 +1347,18 @@ public final class NetworkCapabilities implements Parcelable {
return BitUtils.unpackBits(mTransportTypes); return BitUtils.unpackBits(mTransportTypes);
} }
/**
* Gets the transports as an int. Internal callers only.
*
* Prefer getTransportTypes/hasTransportType if not immediately collapsing back into a scalar.
*
* @return a long integer representing the transport types.
* @hide
*/
public long getTransportTypesInternal() {
return mTransportTypes;
}
/** /**
* Sets all the transports set on this {@code NetworkCapability} instance. * Sets all the transports set on this {@code NetworkCapability} instance.
* This overwrites any existing transports. * This overwrites any existing transports.