Merge "Add APN type XCAP"

This commit is contained in:
Sarah Chin
2019-12-12 22:39:01 +00:00
committed by Gerrit Code Review
4 changed files with 15 additions and 5 deletions

View File

@@ -45500,6 +45500,7 @@ package android.telephony.data {
field public static final int TYPE_MCX = 1024; // 0x400 field public static final int TYPE_MCX = 1024; // 0x400
field public static final int TYPE_MMS = 2; // 0x2 field public static final int TYPE_MMS = 2; // 0x2
field public static final int TYPE_SUPL = 4; // 0x4 field public static final int TYPE_SUPL = 4; // 0x4
field public static final int TYPE_XCAP = 2048; // 0x800
} }
public static class ApnSetting.Builder { public static class ApnSetting.Builder {

View File

@@ -116,7 +116,8 @@ public class Annotation {
ApnSetting.TYPE_CBS, ApnSetting.TYPE_CBS,
ApnSetting.TYPE_IA, ApnSetting.TYPE_IA,
ApnSetting.TYPE_EMERGENCY, ApnSetting.TYPE_EMERGENCY,
ApnSetting.TYPE_MCX ApnSetting.TYPE_MCX,
ApnSetting.TYPE_XCAP,
}) })
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
public @interface ApnType { public @interface ApnType {

View File

@@ -20,7 +20,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.content.ContentValues; import android.content.ContentValues;
import android.database.Cursor; import android.database.Cursor;
import android.hardware.radio.V1_4.ApnTypes; import android.hardware.radio.V1_5.ApnTypes;
import android.net.Uri; import android.net.Uri;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
@@ -110,6 +110,8 @@ public class ApnSetting implements Parcelable {
public static final int TYPE_EMERGENCY = ApnTypes.EMERGENCY; public static final int TYPE_EMERGENCY = ApnTypes.EMERGENCY;
/** APN type for MCX (Mission Critical Service) where X can be PTT/Video/Data */ /** APN type for MCX (Mission Critical Service) where X can be PTT/Video/Data */
public static final int TYPE_MCX = ApnTypes.MCX; public static final int TYPE_MCX = ApnTypes.MCX;
/** APN type for XCAP. */
public static final int TYPE_XCAP = ApnTypes.XCAP;
// Possible values for authentication types. // Possible values for authentication types.
/** No authentication type. */ /** No authentication type. */
@@ -198,6 +200,7 @@ public class ApnSetting implements Parcelable {
APN_TYPE_STRING_MAP.put("ia", TYPE_IA); APN_TYPE_STRING_MAP.put("ia", TYPE_IA);
APN_TYPE_STRING_MAP.put("emergency", TYPE_EMERGENCY); APN_TYPE_STRING_MAP.put("emergency", TYPE_EMERGENCY);
APN_TYPE_STRING_MAP.put("mcx", TYPE_MCX); APN_TYPE_STRING_MAP.put("mcx", TYPE_MCX);
APN_TYPE_STRING_MAP.put("xcap", TYPE_XCAP);
APN_TYPE_INT_MAP = new ArrayMap<Integer, String>(); APN_TYPE_INT_MAP = new ArrayMap<Integer, String>();
APN_TYPE_INT_MAP.put(TYPE_DEFAULT, "default"); APN_TYPE_INT_MAP.put(TYPE_DEFAULT, "default");
APN_TYPE_INT_MAP.put(TYPE_MMS, "mms"); APN_TYPE_INT_MAP.put(TYPE_MMS, "mms");
@@ -210,6 +213,7 @@ public class ApnSetting implements Parcelable {
APN_TYPE_INT_MAP.put(TYPE_IA, "ia"); APN_TYPE_INT_MAP.put(TYPE_IA, "ia");
APN_TYPE_INT_MAP.put(TYPE_EMERGENCY, "emergency"); APN_TYPE_INT_MAP.put(TYPE_EMERGENCY, "emergency");
APN_TYPE_INT_MAP.put(TYPE_MCX, "mcx"); APN_TYPE_INT_MAP.put(TYPE_MCX, "mcx");
APN_TYPE_INT_MAP.put(TYPE_XCAP, "xcap");
PROTOCOL_STRING_MAP = new ArrayMap<String, Integer>(); PROTOCOL_STRING_MAP = new ArrayMap<String, Integer>();
PROTOCOL_STRING_MAP.put("IP", PROTOCOL_IP); PROTOCOL_STRING_MAP.put("IP", PROTOCOL_IP);
@@ -1944,8 +1948,9 @@ public class ApnSetting implements Parcelable {
* {@link ApnSetting} built from this builder otherwise. * {@link ApnSetting} built from this builder otherwise.
*/ */
public ApnSetting build() { public ApnSetting build() {
if ((mApnTypeBitmask & (TYPE_DEFAULT | TYPE_MMS | TYPE_SUPL | TYPE_DUN | TYPE_HIPRI | if ((mApnTypeBitmask & (TYPE_DEFAULT | TYPE_MMS | TYPE_SUPL | TYPE_DUN | TYPE_HIPRI
TYPE_FOTA | TYPE_IMS | TYPE_CBS | TYPE_IA | TYPE_EMERGENCY | TYPE_MCX)) == 0 | TYPE_FOTA | TYPE_IMS | TYPE_CBS | TYPE_IA | TYPE_EMERGENCY | TYPE_MCX
| TYPE_XCAP)) == 0
|| TextUtils.isEmpty(mApnName) || TextUtils.isEmpty(mEntryName)) { || TextUtils.isEmpty(mApnName) || TextUtils.isEmpty(mEntryName)) {
return null; return null;
} }

View File

@@ -161,6 +161,8 @@ public class PhoneConstants {
public static final String APN_TYPE_EMERGENCY = "emergency"; public static final String APN_TYPE_EMERGENCY = "emergency";
/** APN type for Mission Critical Services */ /** APN type for Mission Critical Services */
public static final String APN_TYPE_MCX = "mcx"; public static final String APN_TYPE_MCX = "mcx";
/** APN type for XCAP */
public static final String APN_TYPE_XCAP = "xcap";
/** Array of all APN types */ /** Array of all APN types */
public static final String[] APN_TYPES = {APN_TYPE_DEFAULT, public static final String[] APN_TYPES = {APN_TYPE_DEFAULT,
APN_TYPE_MMS, APN_TYPE_MMS,
@@ -172,7 +174,8 @@ public class PhoneConstants {
APN_TYPE_CBS, APN_TYPE_CBS,
APN_TYPE_IA, APN_TYPE_IA,
APN_TYPE_EMERGENCY, APN_TYPE_EMERGENCY,
APN_TYPE_MCX APN_TYPE_MCX,
APN_TYPE_XCAP,
}; };
public static final int RIL_CARD_MAX_APPS = 8; public static final int RIL_CARD_MAX_APPS = 8;