Merge "Add function to get APN types as ints from bitmask" am: f9bf0a696b

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1729424

Change-Id: Ia2ac0550be0935c6f8ceee25d205fdada7d5a3c6
This commit is contained in:
Sarah Chin
2021-06-08 19:37:04 +00:00
committed by Automerger Merge Worker

View File

@@ -1550,6 +1550,20 @@ public class ApnSetting implements Parcelable {
return TextUtils.join(",", types);
}
/**
* Converts the APN type bitmask to an array of all APN types
* @param apnTypeBitmask bitmask of APN types.
* @return int array of APN types
* @hide
*/
@NonNull
public static int[] getApnTypesFromBitmask(int apnTypeBitmask) {
return APN_TYPE_INT_MAP.keySet().stream()
.filter(type -> ((apnTypeBitmask & type) == type))
.mapToInt(Integer::intValue)
.toArray();
}
/**
* Converts the integer representation of APN type to its string representation.
*