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

Commit f4c048af authored by Aaron Huang's avatar Aaron Huang Committed by Automerger Merge Worker
Browse files

Merge "Expose BIP and VSIM relavent definitions" am: ef743129 am: 112185f2

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

Change-Id: Ibab74f3bcf6c804a31be54d4b7183ea75a6e172e
parents 8e7a6b58 112185f2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -41368,6 +41368,7 @@ package android.telephony.data {
    field public static final int PROTOCOL_NON_IP = 4; // 0x4
    field public static final int PROTOCOL_PPP = 3; // 0x3
    field public static final int PROTOCOL_UNSTRUCTURED = 5; // 0x5
    field public static final int TYPE_BIP = 8192; // 0x2000
    field public static final int TYPE_CBS = 128; // 0x80
    field public static final int TYPE_DEFAULT = 17; // 0x11
    field public static final int TYPE_DUN = 8; // 0x8
@@ -41379,6 +41380,7 @@ package android.telephony.data {
    field public static final int TYPE_MCX = 1024; // 0x400
    field public static final int TYPE_MMS = 2; // 0x2
    field public static final int TYPE_SUPL = 4; // 0x4
    field public static final int TYPE_VSIM = 4096; // 0x1000
    field public static final int TYPE_XCAP = 2048; // 0x800
  }
+2 −0
Original line number Diff line number Diff line
@@ -10551,6 +10551,7 @@ package android.telephony.data {
    method public static int getApnTypeInt(@NonNull String);
    method @NonNull public static String getApnTypeString(int);
    field public static final String TYPE_ALL_STRING = "*";
    field public static final String TYPE_BIP_STRING = "bip";
    field public static final String TYPE_CBS_STRING = "cbs";
    field public static final String TYPE_DEFAULT_STRING = "default";
    field public static final String TYPE_DUN_STRING = "dun";
@@ -10562,6 +10563,7 @@ package android.telephony.data {
    field public static final String TYPE_MCX_STRING = "mcx";
    field public static final String TYPE_MMS_STRING = "mms";
    field public static final String TYPE_SUPL_STRING = "supl";
    field public static final String TYPE_VSIM_STRING = "vsim";
    field public static final String TYPE_XCAP_STRING = "xcap";
  }
+2 −0
Original line number Diff line number Diff line
@@ -277,11 +277,13 @@ package android.net {
    method @NonNull public int[] getTransportTypes();
    method public boolean isPrivateDnsBroken();
    method public boolean satisfiedByNetworkCapabilities(@Nullable android.net.NetworkCapabilities);
    field public static final int NET_CAPABILITY_BIP = 31; // 0x1f
    field public static final int NET_CAPABILITY_NOT_VCN_MANAGED = 28; // 0x1c
    field public static final int NET_CAPABILITY_OEM_PAID = 22; // 0x16
    field public static final int NET_CAPABILITY_OEM_PRIVATE = 26; // 0x1a
    field public static final int NET_CAPABILITY_PARTIAL_CONNECTIVITY = 24; // 0x18
    field public static final int NET_CAPABILITY_VEHICLE_INTERNAL = 27; // 0x1b
    field public static final int NET_CAPABILITY_VSIM = 30; // 0x1e
  }

  public static final class NetworkCapabilities.Builder {
+19 −1
Original line number Diff line number Diff line
@@ -274,6 +274,8 @@ public final class NetworkCapabilities implements Parcelable {
            NET_CAPABILITY_VEHICLE_INTERNAL,
            NET_CAPABILITY_NOT_VCN_MANAGED,
            NET_CAPABILITY_ENTERPRISE,
            NET_CAPABILITY_VSIM,
            NET_CAPABILITY_BIP,
    })
    public @interface NetCapability { }

@@ -493,8 +495,22 @@ public final class NetworkCapabilities implements Parcelable {
     */
    public static final int NET_CAPABILITY_ENTERPRISE = 29;

    /**
     * Indicates that this network has ability to access the carrier's Virtual Sim service.
     * @hide
     */
    @SystemApi
    public static final int NET_CAPABILITY_VSIM = 30;

    /**
     * Indicates that this network has ability to support Bearer Independent Protol.
     * @hide
     */
    @SystemApi
    public static final int NET_CAPABILITY_BIP = 31;

    private static final int MIN_NET_CAPABILITY = NET_CAPABILITY_MMS;
    private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_ENTERPRISE;
    private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_BIP;

    /**
     * Network capabilities that are expected to be mutable, i.e., can change while a particular
@@ -2101,6 +2117,8 @@ public final class NetworkCapabilities implements Parcelable {
            case NET_CAPABILITY_VEHICLE_INTERNAL:     return "VEHICLE_INTERNAL";
            case NET_CAPABILITY_NOT_VCN_MANAGED:      return "NOT_VCN_MANAGED";
            case NET_CAPABILITY_ENTERPRISE:           return "ENTERPRISE";
            case NET_CAPABILITY_VSIM:                 return "VSIM";
            case NET_CAPABILITY_BIP:                  return "BIP";
            default:                                  return Integer.toString(capability);
        }
    }
+39 −2
Original line number Diff line number Diff line
@@ -114,11 +114,15 @@ public class ApnSetting implements Parcelable {
    public static final int TYPE_MCX = ApnTypes.MCX;
    /** APN type for XCAP. */
    public static final int TYPE_XCAP = ApnTypes.XCAP;
    /** APN type for VSIM. */
    public static final int TYPE_VSIM = 1 << 12;  // TODO: Refer to ApnTypes.VSIM
    /** APN type for BIP. */
    public static final int TYPE_BIP = 1 << 13;   // TODO: Refer to ApnTypes.BIP
    /**
     * APN type for ENTERPRISE.
     * @hide
     */
    public static final int TYPE_ENTERPRISE = TYPE_XCAP << 1;
    public static final int TYPE_ENTERPRISE = TYPE_BIP << 1;

    /** @hide */
    @IntDef(flag = true, prefix = {"TYPE_"}, value = {
@@ -134,6 +138,8 @@ public class ApnSetting implements Parcelable {
            TYPE_EMERGENCY,
            TYPE_MCX,
            TYPE_XCAP,
            TYPE_BIP,
            TYPE_VSIM,
            TYPE_ENTERPRISE,
    })
    @Retention(RetentionPolicy.SOURCE)
@@ -174,6 +180,8 @@ public class ApnSetting implements Parcelable {
            TYPE_MMS_STRING,
            TYPE_SUPL_STRING,
            TYPE_XCAP_STRING,
            TYPE_VSIM_STRING,
            TYPE_BIP_STRING,
            TYPE_ENTERPRISE_STRING,
    }, prefix = "TYPE_", suffix = "_STRING")
    @Retention(RetentionPolicy.SOURCE)
@@ -315,8 +323,33 @@ public class ApnSetting implements Parcelable {
    @SystemApi
    public static final String TYPE_XCAP_STRING = "xcap";



    /**
     * APN type for Virtual SIM service.
     *
     * 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
     */
    @SystemApi
    public static final String TYPE_VSIM_STRING = "vsim";

    /**
     * APN type for Bearer Independent Protocol.
     *
     * 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
     */
    @SystemApi
    public static final String TYPE_BIP_STRING = "bip";

    /**
     * APN type for ENTERPRISE traffic.
     *
     * 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
     */
    public static final String TYPE_ENTERPRISE_STRING = "enterprise";
@@ -401,6 +434,8 @@ public class ApnSetting implements Parcelable {
        APN_TYPE_STRING_MAP.put(TYPE_MCX_STRING, TYPE_MCX);
        APN_TYPE_STRING_MAP.put(TYPE_XCAP_STRING, TYPE_XCAP);
        APN_TYPE_STRING_MAP.put(TYPE_ENTERPRISE_STRING, TYPE_ENTERPRISE);
        APN_TYPE_STRING_MAP.put(TYPE_VSIM_STRING, TYPE_VSIM);
        APN_TYPE_STRING_MAP.put(TYPE_BIP_STRING, TYPE_BIP);

        APN_TYPE_INT_MAP = new ArrayMap<>();
        APN_TYPE_INT_MAP.put(TYPE_DEFAULT, TYPE_DEFAULT_STRING);
@@ -416,6 +451,8 @@ public class ApnSetting implements Parcelable {
        APN_TYPE_INT_MAP.put(TYPE_MCX, TYPE_MCX_STRING);
        APN_TYPE_INT_MAP.put(TYPE_XCAP, TYPE_XCAP_STRING);
        APN_TYPE_INT_MAP.put(TYPE_ENTERPRISE, TYPE_ENTERPRISE_STRING);
        APN_TYPE_INT_MAP.put(TYPE_VSIM, TYPE_VSIM_STRING);
        APN_TYPE_INT_MAP.put(TYPE_BIP, TYPE_BIP_STRING);

        PROTOCOL_STRING_MAP = new ArrayMap<>();
        PROTOCOL_STRING_MAP.put("IP", PROTOCOL_IP);
@@ -2194,7 +2231,7 @@ 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_ENTERPRISE)) == 0
                    | TYPE_XCAP | TYPE_VSIM | TYPE_BIP | TYPE_ENTERPRISE)) == 0
                || TextUtils.isEmpty(mApnName) || TextUtils.isEmpty(mEntryName)) {
                return null;
            }