Skip to content
Snippets Groups Projects
Commit f9bf0a69 authored by Sarah Chin's avatar Sarah Chin Committed by Gerrit Code Review
Browse files

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

parents 0503e1c1 a3fce76d
No related branches found
No related tags found
No related merge requests found
......@@ -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.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment