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

Commit 00f24f04 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

Add OEM_PAID and OEM_PRIVATE Apn types

Bug: 366194627
Test: m
Test: manually add oem_paid APN to telephony.db and verify OEM_PAID
      network capability in adb shell dumpsys connectivity
Flag: com.android.internal.telephony.flags.oem_paid_private
Change-Id: Ib5af475115be1c4f110e91163fc21297556ad22c
parent 08718392
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -46629,6 +46629,8 @@ package android.telephony.data {
    field public static final int TYPE_IMS = 64; // 0x40
    field public static final int TYPE_MCX = 1024; // 0x400
    field public static final int TYPE_MMS = 2; // 0x2
    field @FlaggedApi("com.android.internal.telephony.flags.oem_paid_private") public static final int TYPE_OEM_PAID = 65536; // 0x10000
    field @FlaggedApi("com.android.internal.telephony.flags.oem_paid_private") public static final int TYPE_OEM_PRIVATE = 131072; // 0x20000
    field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final int TYPE_RCS = 32768; // 0x8000
    field public static final int TYPE_SUPL = 4; // 0x4
    field public static final int TYPE_VSIM = 4096; // 0x1000
+2 −0
Original line number Diff line number Diff line
@@ -15858,6 +15858,8 @@ package android.telephony.data {
    field public static final String TYPE_IMS_STRING = "ims";
    field public static final String TYPE_MCX_STRING = "mcx";
    field public static final String TYPE_MMS_STRING = "mms";
    field @FlaggedApi("com.android.internal.telephony.flags.oem_paid_private") public static final String TYPE_OEM_PAID_STRING = "oem_paid";
    field @FlaggedApi("com.android.internal.telephony.flags.oem_paid_private") public static final String TYPE_OEM_PRIVATE_STRING = "oem_private";
    field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String TYPE_RCS_STRING = "rcs";
    field public static final String TYPE_SUPL_STRING = "supl";
    field public static final String TYPE_VSIM_STRING = "vsim";
+36 −2
Original line number Diff line number Diff line
@@ -128,6 +128,12 @@ public class ApnSetting implements Parcelable {
    /** APN type for RCS (Rich Communication Services). */
    @FlaggedApi(Flags.FLAG_CARRIER_ENABLED_SATELLITE_FLAG)
    public static final int TYPE_RCS = ApnTypes.RCS;
    /** APN type for OEM_PAID networks (Automotive PANS) */
    @FlaggedApi(Flags.FLAG_OEM_PAID_PRIVATE)
    public static final int TYPE_OEM_PAID = 1 << 16; // TODO(b/366194627): ApnTypes.OEM_PAID;
    /** APN type for OEM_PRIVATE networks (Automotive PANS) */
    @FlaggedApi(Flags.FLAG_OEM_PAID_PRIVATE)
    public static final int TYPE_OEM_PRIVATE = 1 << 17; // TODO(b/366194627): ApnTypes.OEM_PRIVATE;

    /** @hide */
    @IntDef(flag = true, prefix = {"TYPE_"}, value = {
@@ -146,7 +152,9 @@ public class ApnSetting implements Parcelable {
            TYPE_BIP,
            TYPE_VSIM,
            TYPE_ENTERPRISE,
            TYPE_RCS
            TYPE_RCS,
            TYPE_OEM_PAID,
            TYPE_OEM_PRIVATE,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ApnType {
@@ -375,6 +383,27 @@ public class ApnSetting implements Parcelable {
    @SystemApi
    public static final String TYPE_RCS_STRING = "rcs";

    /**
     * APN type for OEM_PAID networks (Automotive PANS)
     *
     * Note: String representations of APN types are intended for system apps to communicate with
     * modem components or carriers. Non-system apps should use the integer variants instead.
     * @hide
     */
    @FlaggedApi(Flags.FLAG_OEM_PAID_PRIVATE)
    @SystemApi
    public static final String TYPE_OEM_PAID_STRING = "oem_paid";

    /**
     * APN type for OEM_PRIVATE networks (Automotive PANS)
     *
     * Note: String representations of APN types are intended for system apps to communicate with
     * modem components or carriers. Non-system apps should use the integer variants instead.
     * @hide
     */
    @FlaggedApi(Flags.FLAG_OEM_PAID_PRIVATE)
    @SystemApi
    public static final String TYPE_OEM_PRIVATE_STRING = "oem_private";

    /** @hide */
    @IntDef(prefix = { "AUTH_TYPE_" }, value = {
@@ -489,6 +518,8 @@ public class ApnSetting implements Parcelable {
        APN_TYPE_STRING_MAP.put(TYPE_VSIM_STRING, TYPE_VSIM);
        APN_TYPE_STRING_MAP.put(TYPE_BIP_STRING, TYPE_BIP);
        APN_TYPE_STRING_MAP.put(TYPE_RCS_STRING, TYPE_RCS);
        APN_TYPE_STRING_MAP.put(TYPE_OEM_PAID_STRING, TYPE_OEM_PAID);
        APN_TYPE_STRING_MAP.put(TYPE_OEM_PRIVATE_STRING, TYPE_OEM_PRIVATE);

        APN_TYPE_INT_MAP = new ArrayMap<>();
        APN_TYPE_INT_MAP.put(TYPE_DEFAULT, TYPE_DEFAULT_STRING);
@@ -507,6 +538,8 @@ public class ApnSetting implements Parcelable {
        APN_TYPE_INT_MAP.put(TYPE_VSIM, TYPE_VSIM_STRING);
        APN_TYPE_INT_MAP.put(TYPE_BIP, TYPE_BIP_STRING);
        APN_TYPE_INT_MAP.put(TYPE_RCS, TYPE_RCS_STRING);
        APN_TYPE_INT_MAP.put(TYPE_OEM_PAID, TYPE_OEM_PAID_STRING);
        APN_TYPE_INT_MAP.put(TYPE_OEM_PRIVATE, TYPE_OEM_PRIVATE_STRING);

        PROTOCOL_STRING_MAP = new ArrayMap<>();
        PROTOCOL_STRING_MAP.put("IP", PROTOCOL_IP);
@@ -2383,7 +2416,8 @@ public class ApnSetting implements Parcelable {
        public ApnSetting build() {
            if ((mApnTypeBitmask & (TYPE_DEFAULT | TYPE_MMS | TYPE_SUPL | TYPE_DUN | TYPE_HIPRI
                    | TYPE_FOTA | TYPE_IMS | TYPE_CBS | TYPE_IA | TYPE_EMERGENCY | TYPE_MCX
                    | TYPE_XCAP | TYPE_VSIM | TYPE_BIP | TYPE_ENTERPRISE | TYPE_RCS)) == 0
                    | TYPE_XCAP | TYPE_VSIM | TYPE_BIP | TYPE_ENTERPRISE | TYPE_RCS | TYPE_OEM_PAID
                    | TYPE_OEM_PRIVATE)) == 0
                || TextUtils.isEmpty(mApnName) || TextUtils.isEmpty(mEntryName)) {
                return null;
            }