ApnSetting
open class ApnSetting : Parcelable
kotlin.Any | |
↳ | android.telephony.data.ApnSetting |
An Access Point Name (APN) configuration for a carrier data connection.
The APN provides configuration to connect a cellular network device to an IP data network. A carrier uses the name, type and other configuration in an APNSetting
to decide which IP address to assign, any security methods to apply, and how the device might be connected to private networks.
Use ApnSetting.Builder
to create new instances.
Summary
Nested classes | |
---|---|
open |
Provides a convenient way to set the fields of a |
Constants | |
---|---|
static Int |
Authentication type for CHAP. |
static Int |
Authentication is not required. |
static Int |
Authentication type for PAP. |
static Int |
Authentication type for PAP or CHAP. |
static Int |
MVNO type for group identifier level 1. |
static Int |
MVNO type for ICCID. |
static Int |
MVNO type for IMSI. |
static Int |
MVNO type for service provider name. |
static Int |
Internet protocol. |
static Int |
Virtual PDP type introduced to handle dual IP stack UE capability. |
static Int |
Internet protocol, version 6. |
static Int |
Transfer of Non-IP data to external packet data network. |
static Int |
Point to point protocol. |
static Int |
Transfer of Unstructured data to the Data Network via N6. |
static Int |
APN type for BIP. |
static Int |
APN type for CBS. |
static Int |
APN type for default data traffic. |
static Int |
APN type for DUN traffic. |
static Int |
APN type for Emergency PDN. |
static Int |
APN type for ENTERPRISE. |
static Int |
APN type for accessing the carrier's FOTA portal, used for over the air updates. |
static Int |
APN type for HiPri traffic. |
static Int |
APN type for IA Initial Attach APN. |
static Int |
APN type for IMS. |
static Int |
APN type for MCX (Mission Critical Service) where X can be PTT/Video/Data |
static Int |
APN type for MMS traffic. |
static Int |
APN type for OEM_PAID networks (Automotive PANS) |
static Int |
APN type for OEM_PRIVATE networks (Automotive PANS) |
static Int |
APN type for RCS (Rich Communication Services). |
static Int |
APN type for SUPL assisted GPS. |
static Int |
APN type for VSIM. |
static Int |
APN type for XCAP. |
Inherited constants | |
---|---|
Public methods | |
---|---|
open Int | |
open Boolean | |
open String! |
Returns the name of the APN. |
open Int |
Returns the bitmask of APN types. |
open Int |
Returns the authentication type of the APN. |
open Int |
Returns the carrier id for this APN. |
open String! |
Gets the human-readable name that describes the APN. |
open Int |
getId() Returns the unique database id for this entry. |
open InetAddress! |
Gets the MMS proxy address configured for the APN. |
open String! |
Returns the MMS proxy address of the APN. |
open Int |
Returns the MMS proxy port of the APN. |
open Uri! |
getMmsc() Returns the MMSC Uri of the APN. |
open Int |
getMtuV4() Returns the default MTU (Maximum Transmission Unit) size in bytes of the IPv4 routes brought up by this APN setting. |
open Int |
getMtuV6() Returns the MTU size of the IPv6 mobile interface to which the APN connected. |
open Int |
Returns the MVNO match type for this APN. |
open Int |
Returns a bitmask describing the Radio Technologies (Network Types) which this APN may use. |
open String! |
Returns the numeric operator ID for the APN. |
open String! |
Returns the APN password of the APN. |
open Int |
Returns the profile id to which the APN saved in modem. |
open Int |
Returns the protocol to use to connect to this APN. |
open InetAddress! |
Gets the HTTP proxy address configured for the APN. |
open String! |
Returns the proxy address of the APN. |
open Int |
Returns the proxy address of the APN. |
open Int |
Returns the protocol to use to connect to this APN while the device is roaming. |
open String! |
getUser() Returns the APN username of the APN. |
open Int |
hashCode() |
open Boolean |
Returns whether User Plane resources have to be activated during every transition from CM-IDLE mode to CM-CONNECTED state for this APN See 3GPP TS 23. |
open Boolean |
Returns the current status of APN. |
open Boolean |
Returns if the APN setting is persistent on the modem. |
open Unit |
writeToParcel(dest: Parcel, flags: Int) Flatten this object in to a Parcel. |
Properties | |
---|---|
static Parcelable.Creator<ApnSetting!> |
Constants
AUTH_TYPE_CHAP
static val AUTH_TYPE_CHAP: Int
Authentication type for CHAP.
Value: 2
AUTH_TYPE_NONE
static val AUTH_TYPE_NONE: Int
Authentication is not required.
Value: 0
AUTH_TYPE_PAP
static val AUTH_TYPE_PAP: Int
Authentication type for PAP.
Value: 1
AUTH_TYPE_PAP_OR_CHAP
static val AUTH_TYPE_PAP_OR_CHAP: Int
Authentication type for PAP or CHAP.
Value: 3
MVNO_TYPE_GID
static val MVNO_TYPE_GID: Int
MVNO type for group identifier level 1.
Value: 2
MVNO_TYPE_SPN
static val MVNO_TYPE_SPN: Int
MVNO type for service provider name.
Value: 0
PROTOCOL_IPV4V6
static val PROTOCOL_IPV4V6: Int
Virtual PDP type introduced to handle dual IP stack UE capability.
Value: 2
PROTOCOL_IPV6
static val PROTOCOL_IPV6: Int
Internet protocol, version 6.
Value: 1
PROTOCOL_NON_IP
static val PROTOCOL_NON_IP: Int
Transfer of Non-IP data to external packet data network.
Value: 4
PROTOCOL_UNSTRUCTURED
static val PROTOCOL_UNSTRUCTURED: Int
Transfer of Unstructured data to the Data Network via N6.
Value: 5
TYPE_DEFAULT
static val TYPE_DEFAULT: Int
APN type for default data traffic.
Value: 17
TYPE_EMERGENCY
static val TYPE_EMERGENCY: Int
APN type for Emergency PDN. This is not an IA apn, but is used for access to carrier services in an emergency call situation.
Value: 512
TYPE_ENTERPRISE
static val TYPE_ENTERPRISE: Int
APN type for ENTERPRISE.
Value: 16384
TYPE_FOTA
static val TYPE_FOTA: Int
APN type for accessing the carrier's FOTA portal, used for over the air updates.
Value: 32
TYPE_IA
static val TYPE_IA: Int
APN type for IA Initial Attach APN.
Value: 256
TYPE_MCX
static val TYPE_MCX: Int
APN type for MCX (Mission Critical Service) where X can be PTT/Video/Data
Value: 1024
TYPE_OEM_PAID
static val TYPE_OEM_PAID: Int
APN type for OEM_PAID networks (Automotive PANS)
Value: 65536
TYPE_OEM_PRIVATE
static val TYPE_OEM_PRIVATE: Int
APN type for OEM_PRIVATE networks (Automotive PANS)
Value: 131072
TYPE_RCS
static val TYPE_RCS: Int
APN type for RCS (Rich Communication Services).
Value: 32768
Public methods
describeContents
open fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
open fun equals(other: Any?): Boolean
Parameters | |
---|---|
obj |
the reference object with which to compare. |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getApnName
open fun getApnName(): String!
Returns the name of the APN.
Return | |
---|---|
String! |
APN name |
getApnTypeBitmask
open fun getApnTypeBitmask(): Int
Returns the bitmask of APN types.
Apn types are usage categories for an APN entry. One APN entry may support multiple APN types, eg, a single APN may service regular internet traffic ("default") as well as MMS-specific connections.
The bitmask of APN types is calculated from APN types defined in ApnSetting
.
getAuthType
open fun getAuthType(): Int
Returns the authentication type of the APN.
Return | |
---|---|
Int |
authentication type Value is android.telephony.data.ApnSetting.AUTH_TYPE_UNKNOWN, android.telephony.data.ApnSetting#AUTH_TYPE_NONE , android.telephony.data.ApnSetting#AUTH_TYPE_PAP , android.telephony.data.ApnSetting#AUTH_TYPE_CHAP , or android.telephony.data.ApnSetting#AUTH_TYPE_PAP_OR_CHAP |
getCarrierId
open fun getCarrierId(): Int
Returns the carrier id for this APN.
Return | |
---|---|
Int |
the carrier id |
getEntryName
open fun getEntryName(): String!
Gets the human-readable name that describes the APN.
Return | |
---|---|
String! |
the entry name for the APN |
getId
open fun getId(): Int
Returns the unique database id for this entry.
Return | |
---|---|
Int |
the unique database id |
getMmsProxyAddress
open fungetMmsProxyAddress(): InetAddress!
Deprecated: use getMmsProxyAddressAsString()
instead.
Gets the MMS proxy address configured for the APN. The MMS proxy address might be an IP address or hostname. This method returns null
if system networking (typically DNS) isn’t available to resolve a hostname value—values set as IP addresses don’t have this restriction. This is a known problem and will be addressed in a future release.
Return | |
---|---|
InetAddress! |
the MMS proxy address or null if DNS isn’t available to resolve a hostname |
getMmsProxyAddressAsString
open fun getMmsProxyAddressAsString(): String!
Returns the MMS proxy address of the APN.
Return | |
---|---|
String! |
MMS proxy address. |
getMmsProxyPort
open fun getMmsProxyPort(): Int
Returns the MMS proxy port of the APN.
Return | |
---|---|
Int |
MMS proxy port |
getMmsc
open fun getMmsc(): Uri!
Returns the MMSC Uri of the APN.
Return | |
---|---|
Uri! |
MMSC Uri. |
getMtuV4
open fun getMtuV4(): Int
Returns the default MTU (Maximum Transmission Unit) size in bytes of the IPv4 routes brought up by this APN setting. Note this value will only be used when MTU size is not provided in DataCallResponse#getMtuV4()
during network bring up.
Return | |
---|---|
Int |
the MTU size in bytes of the route. |
getMtuV6
open fun getMtuV6(): Int
Returns the MTU size of the IPv6 mobile interface to which the APN connected. Note this value will only be used when MTU size is not provided in DataCallResponse#getMtuV6()
during network bring up.
Return | |
---|---|
Int |
the MTU size in bytes of the route. |
getMvnoType
open fun getMvnoType(): Int
Returns the MVNO match type for this APN.
Return | |
---|---|
Int |
the MVNO match type Value is android.telephony.data.ApnSetting.MVNO_TYPE_UNKNOWN, android.telephony.data.ApnSetting#MVNO_TYPE_SPN , android.telephony.data.ApnSetting#MVNO_TYPE_IMSI , android.telephony.data.ApnSetting#MVNO_TYPE_GID , or android.telephony.data.ApnSetting#MVNO_TYPE_ICCID |
getNetworkTypeBitmask
open fun getNetworkTypeBitmask(): Int
Returns a bitmask describing the Radio Technologies (Network Types) which this APN may use. NetworkType bitmask is calculated from NETWORK_TYPE defined in TelephonyManager
. Examples of Network Types include TelephonyManager.NETWORK_TYPE_UNKNOWN
, TelephonyManager.NETWORK_TYPE_GPRS
, TelephonyManager.NETWORK_TYPE_EDGE
.
Return | |
---|---|
Int |
a bitmask describing the Radio Technologies (Network Types) or 0 if it is undefined. |
getOperatorNumeric
open fun getOperatorNumeric(): String!
Returns the numeric operator ID for the APN. Numeric operator ID is defined as android.provider.Telephony.Carriers#MCC
+ android.provider.Telephony.Carriers#MNC
.
Return | |
---|---|
String! |
the numeric operator ID |
getPassword
open fun getPassword(): String!
Returns the APN password of the APN.
Return | |
---|---|
String! |
APN password |
getProfileId
open fun getProfileId(): Int
Returns the profile id to which the APN saved in modem.
Return | |
---|---|
Int |
the profile id of the APN |
getProtocol
open fun getProtocol(): Int
Returns the protocol to use to connect to this APN.
Protocol is one of the PDP_type
values in TS 27.007 section 10.1.1.
getProxyAddress
open fungetProxyAddress(): InetAddress!
Deprecated: use getProxyAddressAsString()
instead.
Gets the HTTP proxy address configured for the APN. The proxy address might be an IP address or hostname. This method returns null
if system networking (typically DNS) isn’t available to resolve a hostname value—values set as IP addresses don’t have this restriction. This is a known problem and will be addressed in a future release.
Return | |
---|---|
InetAddress! |
the HTTP proxy address or null if DNS isn’t available to resolve a hostname |
getProxyAddressAsString
open fun getProxyAddressAsString(): String!
Returns the proxy address of the APN.
Return | |
---|---|
String! |
proxy address. |
getProxyPort
open fun getProxyPort(): Int
Returns the proxy address of the APN.
Return | |
---|---|
Int |
proxy address. |
getRoamingProtocol
open fun getRoamingProtocol(): Int
Returns the protocol to use to connect to this APN while the device is roaming.
Roaming protocol is one of the PDP_type
values in TS 27.007 section 10.1.1.
getUser
open fun getUser(): String!
Returns the APN username of the APN.
Return | |
---|---|
String! |
APN username |
hashCode
open fun hashCode(): Int
Return | |
---|---|
Int |
a hash code value for this object. |
isAlwaysOn
open fun isAlwaysOn(): Boolean
Returns whether User Plane resources have to be activated during every transition from CM-IDLE mode to CM-CONNECTED state for this APN See 3GPP TS 23.501 section 5.6.13
Return | |
---|---|
Boolean |
True if the PDU session for this APN should always be on and false otherwise |
isEnabled
open fun isEnabled(): Boolean
Returns the current status of APN. true
: enabled APN. false
: disabled APN.
Return | |
---|---|
Boolean |
the current status |
isPersistent
open fun isPersistent(): Boolean
Returns if the APN setting is persistent on the modem.
Return | |
---|---|
Boolean |
true if the APN setting is persistent on the modem. |
writeToParcel
open fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
Parameters | |
---|---|
dest |
Parcel: This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |