Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c339c14a authored by Sarah Chin's avatar Sarah Chin Committed by Automerger Merge Worker
Browse files

Merge "Add function to get APN types as ints from bitmask" into sc-dev am:...

Merge "Add function to get APN types as ints from bitmask" into sc-dev am: 327f9159 am: 6c2a6441 am: d8e0683c

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

Change-Id: Ie4c833f8482e7ab5dfba32db7427847a7ac8fec4
parents d1c4793a d8e0683c
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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.
     *