public class TelephonyManager extends Object
You do not instantiate this class directly; instead, you retrieve
a reference to an instance through
Context.getSystemService(Context.TELEPHONY_SERVICE)
.
The returned TelephonyManager will use the default subscription for all calls.
To call an API for a specific subscription, use createForSubscriptionId(int)
. e.g.
telephonyManager = defaultSubTelephonyManager.createForSubscriptionId(subId);
Note that access to some telephony information is permission-protected. Your application cannot access the protected information unless it has the appropriate permissions declared in its manifest file. Where permissions apply, they are noted in the the methods through which you access the protected information.
Modifier and Type | Class and Description |
---|---|
static class |
TelephonyManager.MultiSimVariants |
static interface |
TelephonyManager.WifiCallingChoices
The allowed states of Wi-Fi calling.
|
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_CONFIGURE_VOICEMAIL
Open the voicemail settings activity to make changes to voicemail configuration.
|
static String |
ACTION_EMERGENCY_ASSISTANCE
The emergency dialer may choose to present activities with intent filters for this
action as emergency assistance buttons that launch the activity when clicked.
|
static String |
ACTION_PHONE_STATE_CHANGED
Broadcast intent action indicating that the call state
on the device has changed.
|
static String |
ACTION_PRECISE_CALL_STATE_CHANGED
Broadcast intent action indicating that a precise call state
(cellular) on the device has changed.
|
static String |
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED
Broadcast intent action indicating a data connection has changed,
providing precise information about the connection.
|
static String |
ACTION_RESPOND_VIA_MESSAGE
The Phone app sends this intent when a user opts to respond-via-message during an incoming
call.
|
static String |
ACTION_SHOW_VOICEMAIL_NOTIFICATION
Broadcast intent action for letting custom component know to show voicemail notification.
|
static int |
APPTYPE_CSIM
UICC application type is CSIM
|
static int |
APPTYPE_ISIM
UICC application type is ISIM
|
static int |
APPTYPE_RUIM
UICC application type is RUIM
|
static int |
APPTYPE_SIM
UICC application type is SIM
|
static int |
APPTYPE_USIM
UICC application type is USIM
|
static int |
AUTHTYPE_EAP_AKA
Authentication type for UICC challenge is EAP AKA.
|
static int |
AUTHTYPE_EAP_SIM
Authentication type for UICC challenge is EAP SIM.
|
static int |
CALL_STATE_IDLE
Device call state: No activity.
|
static int |
CALL_STATE_OFFHOOK
Device call state: Off-hook.
|
static int |
CALL_STATE_RINGING
Device call state: Ringing.
|
static int |
CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES |
static int |
CARRIER_PRIVILEGE_STATUS_HAS_ACCESS |
static int |
CARRIER_PRIVILEGE_STATUS_NO_ACCESS |
static int |
CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED |
static int |
DATA_ACTIVITY_DORMANT
Data connection is active, but physical link is down
|
static int |
DATA_ACTIVITY_IN
Data connection activity: Currently receiving IP PPP traffic.
|
static int |
DATA_ACTIVITY_INOUT
Data connection activity: Currently both sending and receiving
IP PPP traffic.
|
static int |
DATA_ACTIVITY_NONE
Data connection activity: No traffic.
|
static int |
DATA_ACTIVITY_OUT
Data connection activity: Currently sending IP PPP traffic.
|
static int |
DATA_CONNECTED
Data connection state: Connected.
|
static int |
DATA_CONNECTING
Data connection state: Currently setting up a data connection.
|
static int |
DATA_DISCONNECTED
Data connection state: Disconnected.
|
static int |
DATA_SUSPENDED
Data connection state: Suspended.
|
static int |
DATA_UNKNOWN
Data connection state: Unknown.
|
static boolean |
EMERGENCY_ASSISTANCE_ENABLED |
static String |
EVENT_DOWNGRADE_DATA_DISABLED
Connection event used to indicate that a video call was downgraded to
audio because the data was disabled. |
static String |
EVENT_DOWNGRADE_DATA_LIMIT_REACHED
Connection event used to indicate that a video call was downgraded to
audio because the data limit was reached. |
static String |
EVENT_HANDOVER_TO_WIFI_FAILED
Connection event used to indicate that an IMS call failed to be
handed over from LTE to WIFI. |
static String |
EVENT_HANDOVER_VIDEO_FROM_WIFI_TO_LTE
Connection event used to indicate that an IMS call has be
successfully handed over from WIFI to LTE. |
static String |
EXTRA_BACKGROUND_CALL_STATE
The lookup key used with the
ACTION_PRECISE_CALL_STATE_CHANGED broadcast
for an integer containing the state of the current background call. |
static String |
EXTRA_CALL_VOICEMAIL_INTENT
The intent to call voicemail.
|
static String |
EXTRA_DATA_APN
The lookup key used with the
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED broadcast
for an String containing the data APN. |
static String |
EXTRA_DATA_APN_TYPE
The lookup key used with the
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED broadcast
for an String containing the data APN type. |
static String |
EXTRA_DATA_CHANGE_REASON
The lookup key used with the
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED broadcast
for an String representation of the change reason. |
static String |
EXTRA_DATA_FAILURE_CAUSE
The lookup key used with the
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED broadcast
for the data connection fail cause. |
static String |
EXTRA_DATA_LINK_PROPERTIES_KEY
The lookup key used with the
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED broadcast
for an String representation of the data interface. |
static String |
EXTRA_DATA_NETWORK_TYPE
The lookup key used with the
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED broadcast
for an integer containing the network type. |
static String |
EXTRA_DATA_STATE
The lookup key used with the
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED broadcast
for an integer containing the state of the current data connection. |
static String |
EXTRA_DISCONNECT_CAUSE
The lookup key used with the
ACTION_PRECISE_CALL_STATE_CHANGED broadcast
for an integer containing the disconnect cause. |
static String |
EXTRA_FOREGROUND_CALL_STATE
The lookup key used with the
ACTION_PRECISE_CALL_STATE_CHANGED broadcast
for an integer containing the state of the current foreground call. |
static String |
EXTRA_INCOMING_NUMBER
The lookup key used with the
ACTION_PHONE_STATE_CHANGED broadcast
for a String containing the incoming phone number. |
static String |
EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT
The intent to launch voicemail settings.
|
static String |
EXTRA_NOTIFICATION_COUNT
The number of voice messages associated with the notification.
|
static String |
EXTRA_PRECISE_DISCONNECT_CAUSE
The lookup key used with the
ACTION_PRECISE_CALL_STATE_CHANGED broadcast
for an integer containing the disconnect cause provided by the RIL. |
static String |
EXTRA_RINGING_CALL_STATE
The lookup key used with the
ACTION_PRECISE_CALL_STATE_CHANGED broadcast
for an integer containing the state of the current ringing call. |
static String |
EXTRA_STATE
The lookup key used with the
ACTION_PHONE_STATE_CHANGED broadcast
for a String containing the new call state. |
static String |
EXTRA_STATE_IDLE
Value used with
EXTRA_STATE corresponding to
CALL_STATE_IDLE . |
static String |
EXTRA_STATE_OFFHOOK
Value used with
EXTRA_STATE corresponding to
CALL_STATE_OFFHOOK . |
static String |
EXTRA_STATE_RINGING
Value used with
EXTRA_STATE corresponding to
CALL_STATE_RINGING . |
static String |
EXTRA_VOICEMAIL_NUMBER
The voicemail number.
|
static String |
MODEM_ACTIVITY_RESULT_KEY
The key to use when placing the result of
requestModemActivityInfo(ResultReceiver)
into the ResultReceiver Bundle. |
static int |
NETWORK_CLASS_2_G
Class of broadly defined "2G" networks.
|
static int |
NETWORK_CLASS_3_G
Class of broadly defined "3G" networks.
|
static int |
NETWORK_CLASS_4_G
Class of broadly defined "4G" networks.
|
static int |
NETWORK_CLASS_UNKNOWN
Unknown network class.
|
static int |
NETWORK_TYPE_1xRTT
Current network is 1xRTT
|
static int |
NETWORK_TYPE_CDMA
Current network is CDMA: Either IS95A or IS95B
|
static int |
NETWORK_TYPE_EDGE
Current network is EDGE
|
static int |
NETWORK_TYPE_EHRPD
Current network is eHRPD
|
static int |
NETWORK_TYPE_EVDO_0
Current network is EVDO revision 0
|
static int |
NETWORK_TYPE_EVDO_A
Current network is EVDO revision A
|
static int |
NETWORK_TYPE_EVDO_B
Current network is EVDO revision B
|
static int |
NETWORK_TYPE_GPRS
Current network is GPRS
|
static int |
NETWORK_TYPE_GSM
Current network is GSM
|
static int |
NETWORK_TYPE_HSDPA
Current network is HSDPA
|
static int |
NETWORK_TYPE_HSPA
Current network is HSPA
|
static int |
NETWORK_TYPE_HSPAP
Current network is HSPA+
|
static int |
NETWORK_TYPE_HSUPA
Current network is HSUPA
|
static int |
NETWORK_TYPE_IDEN
Current network is iDen
|
static int |
NETWORK_TYPE_IWLAN
Current network is IWLAN
|
static int |
NETWORK_TYPE_LTE
Current network is LTE
|
static int |
NETWORK_TYPE_LTE_CA
Current network is LTE_CA
|
static int |
NETWORK_TYPE_TD_SCDMA
Current network is TD_SCDMA
|
static int |
NETWORK_TYPE_UMTS
Current network is UMTS
|
static int |
NETWORK_TYPE_UNKNOWN
Network type is unknown
|
static int |
PHONE_TYPE_CDMA
Phone radio is CDMA.
|
static int |
PHONE_TYPE_GSM
Phone radio is GSM.
|
static int |
PHONE_TYPE_NONE
No phone radio.
|
static int |
PHONE_TYPE_SIP
Phone is via SIP.
|
static int |
SIM_ACTIVATION_RESULT_CANCELED
Response codes for sim activation.
|
static int |
SIM_ACTIVATION_RESULT_COMPLETE
Response codes for sim activation.
|
static int |
SIM_ACTIVATION_RESULT_FAILED
Response codes for sim activation.
|
static int |
SIM_ACTIVATION_RESULT_IN_PROGRESS
Response codes for sim activation.
|
static int |
SIM_ACTIVATION_RESULT_NOT_SUPPORTED
Response codes for sim activation.
|
static int |
SIM_STATE_ABSENT
SIM card state: no SIM card is available in the device
|
static int |
SIM_STATE_CARD_IO_ERROR
SIM card state: SIM Card Error, present but faulty
|
static int |
SIM_STATE_CARD_RESTRICTED
SIM card state: SIM Card restricted, present but not usable due to
carrier restrictions.
|
static int |
SIM_STATE_NETWORK_LOCKED
SIM card state: Locked: requires a network PIN to unlock
|
static int |
SIM_STATE_NOT_READY
SIM card state: SIM Card is NOT READY
|
static int |
SIM_STATE_PERM_DISABLED
SIM card state: SIM Card Error, permanently disabled
|
static int |
SIM_STATE_PIN_REQUIRED
SIM card state: Locked: requires the user's SIM PIN to unlock
|
static int |
SIM_STATE_PUK_REQUIRED
SIM card state: Locked: requires the user's SIM PUK to unlock
|
static int |
SIM_STATE_READY
SIM card state: Ready
|
static int |
SIM_STATE_UNKNOWN
SIM card state: Unknown.
|
static String |
VVM_TYPE_CVVM
A flavor of OMTP protocol with a different mobile originated (MO) format
|
static String |
VVM_TYPE_OMTP
The OMTP protocol.
|
Constructor and Description |
---|
TelephonyManager(Context context) |
TelephonyManager(Context context,
int subId) |
Modifier and Type | Method and Description |
---|---|
void |
answerRingingCall() |
void |
call(String callingPackage,
String number) |
boolean |
canChangeDtmfToneLength()
Whether the device supports configuring the DTMF tone length.
|
void |
carrierActionSetMeteredApnsEnabled(int subId,
boolean enabled)
Action set from carrier signalling broadcast receivers to enable/disable metered apns
Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
|
void |
carrierActionSetRadioEnabled(int subId,
boolean enabled)
Action set from carrier signalling broadcast receivers to enable/disable radio
Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
|
int |
checkCarrierPrivilegesForPackage(String pkgName) |
int |
checkCarrierPrivilegesForPackageAnyPhone(String pkgName) |
TelephonyManager |
createForSubscriptionId(int subId)
Create a new TelephonyManager object pinned to the given subscription ID.
|
void |
dial(String number) |
boolean |
disableDataConnectivity() |
void |
disableLocationUpdates()
Disables location update notifications.
|
void |
disableLocationUpdates(int subId) |
void |
disableVisualVoicemailSmsFilter(int subId) |
boolean |
enableDataConnectivity() |
void |
enableLocationUpdates()
Enables location update notifications.
|
void |
enableLocationUpdates(int subId)
Enables location update notifications for a subscription.
|
void |
enableVideoCalling(boolean enable) |
void |
enableVisualVoicemailSmsFilter(int subId,
VisualVoicemailSmsFilterSettings settings) |
boolean |
endCall() |
void |
factoryReset(int subId)
Resets telephony manager settings back to factory defaults.
|
static TelephonyManager |
from(Context context) |
String |
getAidForAppType(int appType)
Return the application ID for the app type like
APPTYPE_CSIM . |
String |
getAidForAppType(int subId,
int appType)
Return the application ID for the app type like
APPTYPE_CSIM . |
List<CellInfo> |
getAllCellInfo()
Returns all observed cell information from all radios on the
device including the primary and neighboring cells.
|
List<CarrierIdentifier> |
getAllowedCarriers(int slotId)
Get the allowed carrier list for slotId.
|
int |
getCallState()
Returns one of the following constants that represents the current state of all
phone calls.
|
int |
getCallState(int subId)
Returns a constant indicating the call state (cellular) on the device
for a subscription.
|
int |
getCallStateForSlot(int slotId)
See getCallState.
|
List<String> |
getCarrierPackageNamesForIntent(Intent intent) |
List<String> |
getCarrierPackageNamesForIntentAndPhone(Intent intent,
int phoneId) |
int |
getCdmaEriIconIndex()
Returns the CDMA ERI icon index to display
Requires Permission:
READ_PHONE_STATE |
int |
getCdmaEriIconIndex(int subId)
Returns the CDMA ERI icon index to display for a subscription
Requires Permission:
READ_PHONE_STATE |
int |
getCdmaEriIconMode()
Returns the CDMA ERI icon mode,
0 - ON
1 - FLASHING
Requires Permission:
READ_PHONE_STATE |
int |
getCdmaEriIconMode(int subId)
Returns the CDMA ERI icon mode for a subscription.
0 - ON
1 - FLASHING
Requires Permission:
READ_PHONE_STATE |
String |
getCdmaEriText()
Returns the CDMA ERI text,
Requires Permission:
READ_PHONE_STATE |
String |
getCdmaEriText(int subId)
Returns the CDMA ERI text, of a subscription
Requires Permission:
READ_PHONE_STATE |
String |
getCdmaMdn() |
String |
getCdmaMdn(int subId) |
String |
getCdmaMin() |
String |
getCdmaMin(int subId) |
String |
getCdmaPrlVersion()
Return the Preferred Roaming List Version
Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
|
String |
getCdmaPrlVersion(int subId)
Return the Preferred Roaming List Version
Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
|
CellLocation |
getCellLocation()
Returns the current location of the device.
|
CellNetworkScanResult |
getCellNetworkScanResults(int subId)
Perform a radio scan and return the list of avialble networks.
|
String |
getCompleteVoiceMailNumber()
Returns the complete voice mail number.
|
String |
getCompleteVoiceMailNumber(int subId)
Returns the complete voice mail number.
|
int |
getCurrentPhoneType()
Returns the current phone type.
|
int |
getCurrentPhoneType(int subId)
Returns a constant indicating the device phone type for a subscription.
|
int |
getCurrentPhoneTypeForSlot(int slotId)
See getCurrentPhoneType.
|
int |
getDataActivity()
Returns a constant indicating the type of activity on a data connection
(cellular).
|
boolean |
getDataEnabled() |
boolean |
getDataEnabled(int subId) |
int |
getDataNetworkType()
Returns a constant indicating the radio technology (network type)
currently in use on the device for data transmission.
|
int |
getDataNetworkType(int subId)
Returns a constant indicating the radio technology (network type)
currently in use on the device for data transmission for a subscription
|
int |
getDataState()
Returns a constant indicating the current data connection state
(cellular).
|
static TelephonyManager |
getDefault() |
int |
getDefaultSim() |
String |
getDeviceId()
Returns the unique device ID, for example, the IMEI for GSM and the MEID
or ESN for CDMA phones.
|
String |
getDeviceId(int slotId)
Returns the unique device ID of a subscription, for example, the IMEI for
GSM and the MEID for CDMA phones.
|
String |
getDeviceSoftwareVersion()
Returns the software version number for the device, for example,
the IMEI/SV for GSM phones.
|
String |
getDeviceSoftwareVersion(int slotId) |
String |
getEsn()
Return the Electronic Serial Number.
|
String |
getEsn(int subId)
Return the Electronic Serial Number.
|
String |
getGroupIdLevel1()
Returns the Group Identifier Level1 for a GSM phone.
|
String |
getGroupIdLevel1(int subId)
Returns the Group Identifier Level1 for a GSM phone for a particular subscription.
|
String |
getIccAuthentication(int subId,
int appType,
int authType,
String data)
Returns the response of USIM Authentication for specified subId.
|
String |
getIccAuthentication(int appType,
int authType,
String data)
Returns the response of authentication for the default subscription.
|
String |
getImei() |
String |
getImei(int slotId) |
static int |
getIntAtIndex(ContentResolver cr,
String name,
int index)
Convenience function for retrieving a value from the secure settings
value list as an integer.
|
static int |
getIntWithSubId(ContentResolver cr,
String name,
int subId)
This function retrieves value for setting "name+subId", and if that is not found
retrieves value for setting "name", and if that is not found throws
SettingNotFoundException
|
String |
getIsimChallengeResponse(String nonce)
Deprecated.
|
String |
getIsimDomain()
Returns the IMS home network domain name that was loaded from the ISIM.
|
String |
getIsimImpi()
Returns the IMS private user identity (IMPI) that was loaded from the ISIM.
|
String[] |
getIsimImpu()
Returns the IMS public user identities (IMPU) that were loaded from the ISIM.
|
String |
getIsimIst()
Returns the IMS Service Table (IST) that was loaded from the ISIM.
|
String[] |
getIsimPcscf()
Returns the IMS Proxy Call Session Control Function(PCSCF) that were loaded from the ISIM.
|
String |
getLine1AlphaTag()
Returns the alphabetic identifier associated with the line 1 number.
|
String |
getLine1AlphaTag(int subId)
Returns the alphabetic identifier associated with the line 1 number
for a subscription.
|
String |
getLine1Number()
Returns the phone number string for line 1, for example, the MSISDN
for a GSM phone.
|
String |
getLine1Number(int subId)
Returns the phone number string for line 1, for example, the MSISDN
for a GSM phone for a particular subscription.
|
String |
getLocaleFromDefaultSim() |
int |
getLteOnCdmaMode()
Return if the current radio is LTE on CDMA.
|
int |
getLteOnCdmaMode(int subId)
Return if the current radio is LTE on CDMA for Subscription.
|
static int |
getLteOnCdmaModeStatic()
Return if the current radio is LTE on CDMA.
|
String[] |
getMergedSubscriberIds()
Return the set of subscriber IDs that should be considered as "merged
together" for data usage purposes.
|
String |
getMmsUAProfUrl()
Returns the MMS user agent profile URL.
|
String |
getMmsUserAgent()
Returns the MMS user agent.
|
String |
getMsisdn()
Returns the MSISDN string.
|
String |
getMsisdn(int subId)
Returns the MSISDN string.
|
TelephonyManager.MultiSimVariants |
getMultiSimConfiguration() |
String |
getNai() |
String |
getNai(int slotId) |
List<NeighboringCellInfo> |
getNeighboringCellInfo()
Deprecated.
Use (@link getAllCellInfo} which returns a superset of the information
from NeighboringCellInfo.
|
static int |
getNetworkClass(int networkType)
Return general class of network type, such as "3G" or "4G".
|
String |
getNetworkCountryIso()
Returns the ISO country code equivalent of the current registered
operator's MCC (Mobile Country Code).
|
String |
getNetworkCountryIso(int subId)
Returns the ISO country code equivalent of the current registered
operator's MCC (Mobile Country Code) of a subscription.
|
String |
getNetworkCountryIsoForPhone(int phoneId) |
String |
getNetworkOperator()
Returns the numeric name (MCC+MNC) of current registered operator.
|
String |
getNetworkOperator(int subId)
Returns the numeric name (MCC+MNC) of current registered operator
for a particular subscription.
|
String |
getNetworkOperatorForPhone(int phoneId)
Returns the numeric name (MCC+MNC) of current registered operator
for a particular subscription.
|
String |
getNetworkOperatorName()
Returns the alphabetic name of current registered operator.
|
String |
getNetworkOperatorName(int subId)
Returns the alphabetic name of current registered operator
for a particular subscription.
|
int |
getNetworkType() |
int |
getNetworkType(int subId)
Returns a constant indicating the radio technology (network type)
currently in use on the device for a subscription.
|
String |
getNetworkTypeName()
Returns a string representation of the radio technology (network type)
currently in use on the device.
|
static String |
getNetworkTypeName(int type) |
String |
getOtaSpNumberSchema(String defaultValue)
Get OTASP number schema for the default phone.
|
String |
getOtaSpNumberSchemaForPhone(int phoneId,
String defaultValue)
Get OTASP number schema by phone id.
|
List<String> |
getPackagesWithCarrierPrivileges() |
String[] |
getPcscfAddress(String apnType)
Get P-CSCF address from PCO after data connection is established or modified.
|
int |
getPhoneCount()
Returns the number of phones available.
|
int |
getPhoneType()
Returns a constant indicating the device phone type.
|
static int |
getPhoneType(int networkMode)
This function returns the type of the phone, depending
on the network mode.
|
int |
getPreferredNetworkType(int subId)
Get the preferred network type.
|
ServiceState |
getServiceStateForSubscriber(int subId)
Returns the service state information on specified subscription.
|
int |
getSimCount() |
String |
getSimCountryIso()
Returns the ISO country code equivalent for the SIM provider's country code.
|
String |
getSimCountryIso(int subId)
Returns the ISO country code equivalent for the SIM provider's country code.
|
String |
getSimCountryIsoForPhone(int phoneId)
Returns the ISO country code equivalent for the SIM provider's country code.
|
String |
getSimOperator()
Returns the MCC+MNC (mobile country code + mobile network code) of the
provider of the SIM. 5 or 6 decimal digits.
|
String |
getSimOperator(int subId)
Returns the MCC+MNC (mobile country code + mobile network code) of the
provider of the SIM. 5 or 6 decimal digits.
|
String |
getSimOperatorName()
Returns the Service Provider Name (SPN).
|
String |
getSimOperatorName(int subId)
Returns the Service Provider Name (SPN).
|
String |
getSimOperatorNameForPhone(int phoneId)
Returns the Service Provider Name (SPN).
|
String |
getSimOperatorNumeric()
Returns the MCC+MNC (mobile country code + mobile network code) of the
provider of the SIM. 5 or 6 decimal digits.
|
String |
getSimOperatorNumeric(int subId)
Returns the MCC+MNC (mobile country code + mobile network code) of the
provider of the SIM for a particular subscription. 5 or 6 decimal digits.
|
String |
getSimOperatorNumericForPhone(int phoneId)
Returns the MCC+MNC (mobile country code + mobile network code) of the
provider of the SIM for a particular subscription. 5 or 6 decimal digits.
|
String |
getSimSerialNumber()
Returns the serial number of the SIM, if applicable.
|
String |
getSimSerialNumber(int subId)
Returns the serial number for the given subscription, if applicable.
|
int |
getSimState()
Returns a constant indicating the state of the default SIM card.
|
int |
getSimState(int slotIdx) |
boolean |
getSmsReceiveCapable(boolean defaultValue)
Get SMS receive capable from system property for the default phone.
|
boolean |
getSmsReceiveCapableForPhone(int phoneId,
boolean defaultValue)
Get SMS receive capable from system property by phone id.
|
boolean |
getSmsSendCapable(boolean defaultValue)
Get SMS send capable from system property for the default phone.
|
boolean |
getSmsSendCapableForPhone(int phoneId,
boolean defaultValue)
Get SMS send capable from system property by phone id.
|
int |
getSubIdForPhoneAccount(PhoneAccount phoneAccount)
Returns the subscription ID for the given phone account.
|
String |
getSubscriberId()
Returns the unique subscriber ID, for example, the IMSI for a GSM phone.
|
String |
getSubscriberId(int subId)
Returns the unique subscriber ID, for example, the IMSI for a GSM phone
for a subscription.
|
List<TelephonyHistogram> |
getTelephonyHistograms()
Get snapshot of Telephony histograms
|
static String |
getTelephonyProperty(int phoneId,
String property,
String defaultVal)
Gets the telephony property.
|
int |
getTetherApnRequired()
Check TETHER_DUN_REQUIRED and TETHER_DUN_APN settings, net.tethering.noprovisioning
SystemProperty, and config_tether_apndata to decide whether DUN APN is required for
tethering.
|
VisualVoicemailSmsFilterSettings |
getVisualVoicemailSmsFilterSettings(int subId) |
VisualVoicemailSmsFilterSettings |
getVisualVoicemailSmsFilterSettings(String packageName,
int subId) |
String |
getVoiceMailAlphaTag()
Retrieves the alphabetic identifier associated with the voice
mail number.
|
String |
getVoiceMailAlphaTag(int subId)
Retrieves the alphabetic identifier associated with the voice
mail number for a subscription.
|
String |
getVoiceMailNumber()
Returns the voice mail number.
|
String |
getVoiceMailNumber(int subId)
Returns the voice mail number for a subscription.
|
Uri |
getVoicemailRingtoneUri(PhoneAccountHandle accountHandle)
Returns the URI for the per-account voicemail ringtone set in Phone settings.
|
int |
getVoiceMessageCount()
Returns the voice mail count.
|
int |
getVoiceMessageCount(int subId)
Returns the voice mail count for a subscription.
|
int |
getVoiceNetworkType()
Returns the NETWORK_TYPE_xxxx for voice
Requires Permission:
READ_PHONE_STATE |
int |
getVoiceNetworkType(int subId)
Returns the NETWORK_TYPE_xxxx for voice for a subId
Requires Permission:
READ_PHONE_STATE |
long |
getVtDataUsage()
Get aggregated video call data usage since boot.
|
boolean |
handlePinMmi(String dialString) |
boolean |
handlePinMmiForSubscriber(int subId,
String dialString) |
boolean |
hasCarrierPrivileges()
Has the calling application been granted carrier privileges by the carrier.
|
boolean |
hasCarrierPrivileges(int subId)
Has the calling application been granted carrier privileges by the carrier.
|
boolean |
hasIccCard() |
boolean |
hasIccCard(int slotId) |
boolean |
iccCloseLogicalChannel(int channel)
Closes a previously opened logical channel to the ICC card.
|
boolean |
iccCloseLogicalChannel(int subId,
int channel)
Closes a previously opened logical channel to the ICC card.
|
byte[] |
iccExchangeSimIO(int subId,
int fileID,
int command,
int p1,
int p2,
int p3,
String filePath)
Returns the response APDU for a command APDU sent through SIM_IO.
|
byte[] |
iccExchangeSimIO(int fileID,
int command,
int p1,
int p2,
int p3,
String filePath)
Returns the response APDU for a command APDU sent through SIM_IO.
|
IccOpenLogicalChannelResponse |
iccOpenLogicalChannel(int subId,
String AID)
Opens a logical channel to the ICC card.
|
IccOpenLogicalChannelResponse |
iccOpenLogicalChannel(String AID)
Opens a logical channel to the ICC card.
|
String |
iccTransmitApduBasicChannel(int subId,
int cla,
int instruction,
int p1,
int p2,
int p3,
String data)
Transmit an APDU to the ICC card over the basic channel.
|
String |
iccTransmitApduBasicChannel(int cla,
int instruction,
int p1,
int p2,
int p3,
String data)
Transmit an APDU to the ICC card over the basic channel.
|
String |
iccTransmitApduLogicalChannel(int subId,
int channel,
int cla,
int instruction,
int p1,
int p2,
int p3,
String data)
Transmit an APDU to the ICC card over a logical channel.
|
String |
iccTransmitApduLogicalChannel(int channel,
int cla,
int instruction,
int p1,
int p2,
int p3,
String data)
Transmit an APDU to the ICC card over a logical channel.
|
int |
invokeOemRilRequestRaw(byte[] oemReq,
byte[] oemResp)
Returns the result and response from RIL for oem request
|
boolean |
isDataConnectivityPossible() |
boolean |
isHearingAidCompatibilitySupported()
Whether the phone supports hearing aid compatibility.
|
boolean |
isIdle() |
boolean |
isImsRegistered()
Returns the IMS Registration Status
|
boolean |
isMultiSimEnabled() |
boolean |
isNetworkRoaming()
Returns true if the device is considered roaming on the current
network, for GSM purposes.
|
boolean |
isNetworkRoaming(int subId)
Returns true if the device is considered roaming on the current
network for a subscription.
|
boolean |
isOffhook() |
boolean |
isRadioOn() |
boolean |
isRinging() |
boolean |
isSmsCapable() |
boolean |
isTtyModeSupported()
Whether the phone supports TTY mode.
|
boolean |
isVideoCallingEnabled() |
boolean |
isVideoTelephonyAvailable()
Returns the Status of video telephony (VT)
|
boolean |
isVisualVoicemailEnabled(PhoneAccountHandle phoneAccountHandle)
Returns whether the visual voicemail client is enabled.
|
boolean |
isVoiceCapable() |
boolean |
isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle)
Returns whether vibration is set for voicemail notification in Phone settings.
|
boolean |
isVolteAvailable()
Returns the Status of Volte
|
boolean |
isWifiCallingAvailable()
Returns the Status of Wi-Fi Calling
|
boolean |
isWorldPhone()
Whether the device is a world phone.
|
void |
listen(PhoneStateListener listener,
int events)
Registers a listener object to receive notification of changes
in specified telephony states.
|
boolean |
needsOtaServiceProvisioning() |
String |
nvReadItem(int itemID)
Read one of the NV items defined in com.android.internal.telephony.RadioNVItems.
|
boolean |
nvResetConfig(int resetType)
Perform the specified type of NV config reset.
|
boolean |
nvWriteCdmaPrl(byte[] preferredRoamingList)
Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
|
boolean |
nvWriteItem(int itemID,
String itemValue)
Write one of the NV items defined in com.android.internal.telephony.RadioNVItems.
|
static boolean |
putIntAtIndex(ContentResolver cr,
String name,
int index,
int value)
Convenience function for updating settings value as coma separated
integer values.
|
void |
requestModemActivityInfo(ResultReceiver result)
Requests the modem activity info.
|
String |
sendEnvelopeWithStatus(int subId,
String content)
Send ENVELOPE to the SIM and return the response.
|
String |
sendEnvelopeWithStatus(String content)
Send ENVELOPE to the SIM and return the response.
|
int |
setAllowedCarriers(int slotId,
List<CarrierIdentifier> carriers)
Set the allowed carrier list for slotId
Require system privileges.
|
void |
setBasebandVersion(String version)
Set baseband version for the default phone.
|
void |
setBasebandVersionForPhone(int phoneId,
String version)
Set baseband version by phone id.
|
void |
setCellInfoListRate(int rateInMillis)
Sets the minimum time in milli-seconds between
PhoneStateListener.onCellInfoChanged will be invoked. |
void |
setDataEnabled(boolean enable) |
void |
setDataEnabled(int subId,
boolean enable) |
void |
setDataNetworkType(int type)
Set the network type currently in use on the device for data transmission.
|
void |
setDataNetworkTypeForPhone(int phoneId,
int type)
Set the network type currently in use on the device for data transmission.
|
void |
setImsRegistrationState(boolean registered)
Set IMS registration state
|
boolean |
setLine1NumberForDisplay(int subId,
String alphaTag,
String number)
Set the line 1 phone number string and its alphatag for the current ICCID
for display purpose only, for example, displayed in Phone Status.
|
boolean |
setLine1NumberForDisplay(String alphaTag,
String number)
Set the line 1 phone number string and its alphatag for the current ICCID
for display purpose only, for example, displayed in Phone Status.
|
void |
setNetworkCountryIso(String iso)
Set the ISO country code equivalent of the current registered
operator's MCC (Mobile Country Code).
|
void |
setNetworkCountryIsoForPhone(int phoneId,
String iso)
Set the ISO country code equivalent of the current registered
operator's MCC (Mobile Country Code).
|
void |
setNetworkOperatorName(String name)
Set the alphabetic name of current registered operator.
|
void |
setNetworkOperatorNameForPhone(int phoneId,
String name)
Set the alphabetic name of current registered operator.
|
void |
setNetworkOperatorNumeric(String numeric)
Set the numeric name (MCC+MNC) of current registered operator.
|
void |
setNetworkOperatorNumericForPhone(int phoneId,
String numeric)
Set the numeric name (MCC+MNC) of current registered operator.
|
void |
setNetworkRoaming(boolean isRoaming)
Set roaming state of the current network, for GSM purposes.
|
void |
setNetworkRoamingForPhone(int phoneId,
boolean isRoaming)
Set roaming state of the current network, for GSM purposes.
|
void |
setNetworkSelectionModeAutomatic(int subId)
Sets the network selection mode to automatic.
|
boolean |
setNetworkSelectionModeManual(int subId,
OperatorInfo operator,
boolean persistSelection)
Ask the radio to connect to the input network and change selection mode to manual.
|
boolean |
setOperatorBrandOverride(int subId,
String brand)
Override the branding for the current ICCID.
|
boolean |
setOperatorBrandOverride(String brand)
Override the branding for the current ICCID.
|
void |
setPhoneType(int type)
Set phone type for the default phone.
|
void |
setPhoneType(int phoneId,
int type)
Set phone type by phone id.
|
void |
setPolicyDataEnabled(boolean enabled,
int subId)
Policy control of data connection.
|
boolean |
setPreferredNetworkType(int subId,
int networkType)
Set the preferred network type.
|
boolean |
setPreferredNetworkTypeToGlobal()
Set the preferred network type to global mode which includes LTE, CDMA, EvDo and GSM/WCDMA.
|
boolean |
setPreferredNetworkTypeToGlobal(int subId)
Set the preferred network type to global mode which includes LTE, CDMA, EvDo and GSM/WCDMA.
|
boolean |
setRadio(boolean turnOn) |
boolean |
setRadioPower(boolean turnOn) |
boolean |
setRoamingOverride(int subId,
List<String> gsmRoamingList,
List<String> gsmNonRoamingList,
List<String> cdmaRoamingList,
List<String> cdmaNonRoamingList)
Override the roaming preference for the current ICCID.
|
boolean |
setRoamingOverride(List<String> gsmRoamingList,
List<String> gsmNonRoamingList,
List<String> cdmaRoamingList,
List<String> cdmaNonRoamingList)
Override the roaming preference for the current ICCID.
|
void |
setSimCountryIso(String iso)
Set TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY for the default phone.
|
void |
setSimCountryIsoForPhone(int phoneId,
String iso)
Set TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY for the given phone.
|
void |
setSimOperatorName(String name)
Set TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC for the default phone.
|
void |
setSimOperatorNameForPhone(int phoneId,
String name)
Set TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC for the given phone.
|
void |
setSimOperatorNumeric(String numeric)
Set TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC for the default phone.
|
void |
setSimOperatorNumericForPhone(int phoneId,
String numeric)
Set TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC for the given phone.
|
void |
setSimState(String state)
Set TelephonyProperties.PROPERTY_SIM_STATE for the default phone.
|
void |
setSimStateForPhone(int phoneId,
String state)
Set TelephonyProperties.PROPERTY_SIM_STATE for the given phone.
|
static void |
setTelephonyProperty(int phoneId,
String property,
String value)
Sets the telephony property with the value specified.
|
void |
setVisualVoicemailEnabled(PhoneAccountHandle phoneAccountHandle,
boolean enabled)
Enables or disables the visual voicemail client for a phone account.
|
boolean |
setVoiceMailNumber(int subId,
String alphaTag,
String number)
Sets the voicemail number for the given subscriber.
|
boolean |
setVoiceMailNumber(String alphaTag,
String number)
Sets the voice mail number.
|
void |
silenceRinger() |
boolean |
supplyPin(String pin) |
int[] |
supplyPinReportResult(String pin) |
boolean |
supplyPuk(String puk,
String pin) |
int[] |
supplyPukReportResult(String puk,
String pin) |
void |
toggleRadioOnOff() |
void |
updateServiceLocation() |
public static final String MODEM_ACTIVITY_RESULT_KEY
requestModemActivityInfo(ResultReceiver)
into the ResultReceiver Bundle.public static final String ACTION_PHONE_STATE_CHANGED
The EXTRA_STATE
extra indicates the new call state.
If the new state is RINGING, a second extra
EXTRA_INCOMING_NUMBER
provides the incoming phone number as
a String.
Requires the READ_PHONE_STATE permission.
This was a sticky
broadcast in version 1.0, but it is no longer sticky.
Instead, use getCallState()
to synchronously query the current call state.
public static final String ACTION_RESPOND_VIA_MESSAGE
Service
and sending the message using its own messaging system.
The intent contains a URI (available from Intent.getData()
)
describing the recipient, using either the sms:
, smsto:
, mms:
,
or mmsto:
URI schema. Each of these URI schema carry the recipient information the
same way: the path part of the URI contains the recipient's phone number or a comma-separated
set of phone numbers if there are multiple recipients. For example, smsto:2065551234
.
The intent may also contain extras for the message text (in Intent.EXTRA_TEXT
) and a message subject
(in Intent.EXTRA_SUBJECT
).
Note:
The intent-filter that consumes this Intent needs to be in a Service
that requires the
permission android.Manifest.permission#SEND_RESPOND_VIA_MESSAGE
.
For example, the service that receives this intent can be declared in the manifest file with an intent filter like this:
<!-- Service that delivers SMS messages received from the phone "quick response" --> <service android:name=".HeadlessSmsSendService" android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE" android:exported="true" > <intent-filter> <action android:name="android.intent.action.RESPOND_VIA_MESSAGE" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="sms" /> <data android:scheme="smsto" /> <data android:scheme="mms" /> <data android:scheme="mmsto" /> </intent-filter> </service>
Output: nothing.
public static final String ACTION_EMERGENCY_ASSISTANCE
public static final String ACTION_CONFIGURE_VOICEMAIL
public static final boolean EMERGENCY_ASSISTANCE_ENABLED
public static final String EXTRA_STATE
ACTION_PHONE_STATE_CHANGED
broadcast
for a String containing the new call state.public static final String EXTRA_STATE_IDLE
EXTRA_STATE
corresponding to
CALL_STATE_IDLE
.public static final String EXTRA_STATE_RINGING
EXTRA_STATE
corresponding to
CALL_STATE_RINGING
.public static final String EXTRA_STATE_OFFHOOK
EXTRA_STATE
corresponding to
CALL_STATE_OFFHOOK
.public static final String EXTRA_INCOMING_NUMBER
ACTION_PHONE_STATE_CHANGED
broadcast
for a String containing the incoming phone number.
Only valid when the new call state is RINGING.
Retrieve with
Intent.getStringExtra(String)
.
public static final String ACTION_PRECISE_CALL_STATE_CHANGED
The EXTRA_RINGING_CALL_STATE
extra indicates the ringing call state.
The EXTRA_FOREGROUND_CALL_STATE
extra indicates the foreground call state.
The EXTRA_BACKGROUND_CALL_STATE
extra indicates the background call state.
The EXTRA_DISCONNECT_CAUSE
extra indicates the disconnect cause.
The EXTRA_PRECISE_DISCONNECT_CAUSE
extra indicates the precise disconnect cause.
Requires the READ_PRECISE_PHONE_STATE permission.
public static final String EXTRA_RINGING_CALL_STATE
ACTION_PRECISE_CALL_STATE_CHANGED
broadcast
for an integer containing the state of the current ringing call.PreciseCallState.PRECISE_CALL_STATE_NOT_VALID
,
PreciseCallState.PRECISE_CALL_STATE_IDLE
,
PreciseCallState.PRECISE_CALL_STATE_ACTIVE
,
PreciseCallState.PRECISE_CALL_STATE_HOLDING
,
PreciseCallState.PRECISE_CALL_STATE_DIALING
,
PreciseCallState.PRECISE_CALL_STATE_ALERTING
,
PreciseCallState.PRECISE_CALL_STATE_INCOMING
,
PreciseCallState.PRECISE_CALL_STATE_WAITING
,
PreciseCallState.PRECISE_CALL_STATE_DISCONNECTED
,
Retrieve with
{@link android.content.Intent#getIntExtra(String name, int defaultValue)}.
,
Constant Field Valuespublic static final String EXTRA_FOREGROUND_CALL_STATE
ACTION_PRECISE_CALL_STATE_CHANGED
broadcast
for an integer containing the state of the current foreground call.PreciseCallState.PRECISE_CALL_STATE_NOT_VALID
,
PreciseCallState.PRECISE_CALL_STATE_IDLE
,
PreciseCallState.PRECISE_CALL_STATE_ACTIVE
,
PreciseCallState.PRECISE_CALL_STATE_HOLDING
,
PreciseCallState.PRECISE_CALL_STATE_DIALING
,
PreciseCallState.PRECISE_CALL_STATE_ALERTING
,
PreciseCallState.PRECISE_CALL_STATE_INCOMING
,
PreciseCallState.PRECISE_CALL_STATE_WAITING
,
PreciseCallState.PRECISE_CALL_STATE_DISCONNECTED
,
Retrieve with
{@link android.content.Intent#getIntExtra(String name, int defaultValue)}.
,
Constant Field Valuespublic static final String EXTRA_BACKGROUND_CALL_STATE
ACTION_PRECISE_CALL_STATE_CHANGED
broadcast
for an integer containing the state of the current background call.PreciseCallState.PRECISE_CALL_STATE_NOT_VALID
,
PreciseCallState.PRECISE_CALL_STATE_IDLE
,
PreciseCallState.PRECISE_CALL_STATE_ACTIVE
,
PreciseCallState.PRECISE_CALL_STATE_HOLDING
,
PreciseCallState.PRECISE_CALL_STATE_DIALING
,
PreciseCallState.PRECISE_CALL_STATE_ALERTING
,
PreciseCallState.PRECISE_CALL_STATE_INCOMING
,
PreciseCallState.PRECISE_CALL_STATE_WAITING
,
PreciseCallState.PRECISE_CALL_STATE_DISCONNECTED
,
Retrieve with
{@link android.content.Intent#getIntExtra(String name, int defaultValue)}.
,
Constant Field Valuespublic static final String EXTRA_DISCONNECT_CAUSE
ACTION_PRECISE_CALL_STATE_CHANGED
broadcast
for an integer containing the disconnect cause.public static final String EXTRA_PRECISE_DISCONNECT_CAUSE
ACTION_PRECISE_CALL_STATE_CHANGED
broadcast
for an integer containing the disconnect cause provided by the RIL.public static final String ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED
The EXTRA_DATA_STATE
extra indicates the connection state.
The EXTRA_DATA_NETWORK_TYPE
extra indicates the connection network type.
The EXTRA_DATA_APN_TYPE
extra indicates the APN type.
The EXTRA_DATA_APN
extra indicates the APN.
The EXTRA_DATA_CHANGE_REASON
extra indicates the connection change reason.
The #EXTRA_DATA_IFACE_PROPERTIES
extra indicates the connection interface.
The EXTRA_DATA_FAILURE_CAUSE
extra indicates the connection fail cause.
Requires the READ_PRECISE_PHONE_STATE permission.
EXTRA_DATA_STATE
,
EXTRA_DATA_NETWORK_TYPE
,
EXTRA_DATA_APN_TYPE
,
EXTRA_DATA_APN
,
EXTRA_DATA_CHANGE_REASON
,
#EXTRA_DATA_IFACE
,
EXTRA_DATA_FAILURE_CAUSE
,
Constant Field Valuespublic static final String EXTRA_DATA_STATE
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED
broadcast
for an integer containing the state of the current data connection.public static final String EXTRA_DATA_NETWORK_TYPE
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED
broadcast
for an integer containing the network type.NETWORK_TYPE_UNKNOWN
,
NETWORK_TYPE_GPRS
,
NETWORK_TYPE_EDGE
,
NETWORK_TYPE_UMTS
,
NETWORK_TYPE_CDMA
,
NETWORK_TYPE_EVDO_0
,
NETWORK_TYPE_EVDO_A
,
NETWORK_TYPE_1xRTT
,
NETWORK_TYPE_HSDPA
,
NETWORK_TYPE_HSUPA
,
NETWORK_TYPE_HSPA
,
NETWORK_TYPE_IDEN
,
NETWORK_TYPE_EVDO_B
,
NETWORK_TYPE_LTE
,
NETWORK_TYPE_EHRPD
,
Retrieve with
{@link android.content.Intent#getIntExtra(String name, int defaultValue)}.
,
Constant Field Valuespublic static final String EXTRA_DATA_APN_TYPE
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED
broadcast
for an String containing the data APN type.
Retrieve with
Intent.getStringExtra(String name)
.
public static final String EXTRA_DATA_APN
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED
broadcast
for an String containing the data APN.
Retrieve with
Intent.getStringExtra(String name)
.
public static final String EXTRA_DATA_CHANGE_REASON
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED
broadcast
for an String representation of the change reason.
Retrieve with
Intent.getStringExtra(String name)
.
public static final String EXTRA_DATA_LINK_PROPERTIES_KEY
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED
broadcast
for an String representation of the data interface.
Retrieve with
Intent.getParcelableExtra(String name)
.
public static final String EXTRA_DATA_FAILURE_CAUSE
ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED
broadcast
for the data connection fail cause.
Retrieve with
Intent.getStringExtra(String name)
.
public static final String ACTION_SHOW_VOICEMAIL_NOTIFICATION
public static final String EXTRA_NOTIFICATION_COUNT
public static final String EXTRA_VOICEMAIL_NUMBER
public static final String EXTRA_CALL_VOICEMAIL_INTENT
public static final String EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT
public static final String EVENT_HANDOVER_VIDEO_FROM_WIFI_TO_LTE
Connection
event used to indicate that an IMS call has be
successfully handed over from WIFI to LTE.
Sent via Connection.sendConnectionEvent(String, Bundle)
.
The Bundle
parameter is expected to be null when this connection event is used.
public static final String EVENT_HANDOVER_TO_WIFI_FAILED
Connection
event used to indicate that an IMS call failed to be
handed over from LTE to WIFI.
Sent via Connection.sendConnectionEvent(String, Bundle)
.
The Bundle
parameter is expected to be null when this connection event is used.
public static final String EVENT_DOWNGRADE_DATA_LIMIT_REACHED
Connection
event used to indicate that a video call was downgraded to
audio because the data limit was reached.
Sent via Connection.sendConnectionEvent(String, Bundle)
.
The Bundle
parameter is expected to be null when this connection event is used.
public static final String EVENT_DOWNGRADE_DATA_DISABLED
Connection
event used to indicate that a video call was downgraded to
audio because the data was disabled.
Sent via Connection.sendConnectionEvent(String, Bundle)
.
The Bundle
parameter is expected to be null when this connection event is used.
public static final int SIM_ACTIVATION_RESULT_COMPLETE
public static final int SIM_ACTIVATION_RESULT_NOT_SUPPORTED
public static final int SIM_ACTIVATION_RESULT_IN_PROGRESS
public static final int SIM_ACTIVATION_RESULT_FAILED
public static final int SIM_ACTIVATION_RESULT_CANCELED
public static final String VVM_TYPE_OMTP
public static final String VVM_TYPE_CVVM
public static final int PHONE_TYPE_NONE
public static final int PHONE_TYPE_GSM
public static final int PHONE_TYPE_CDMA
public static final int PHONE_TYPE_SIP
public static final int NETWORK_TYPE_UNKNOWN
public static final int NETWORK_TYPE_GPRS
public static final int NETWORK_TYPE_EDGE
public static final int NETWORK_TYPE_UMTS
public static final int NETWORK_TYPE_CDMA
public static final int NETWORK_TYPE_EVDO_0
public static final int NETWORK_TYPE_EVDO_A
public static final int NETWORK_TYPE_1xRTT
public static final int NETWORK_TYPE_HSDPA
public static final int NETWORK_TYPE_HSUPA
public static final int NETWORK_TYPE_HSPA
public static final int NETWORK_TYPE_IDEN
public static final int NETWORK_TYPE_EVDO_B
public static final int NETWORK_TYPE_LTE
public static final int NETWORK_TYPE_EHRPD
public static final int NETWORK_TYPE_HSPAP
public static final int NETWORK_TYPE_GSM
public static final int NETWORK_TYPE_TD_SCDMA
public static final int NETWORK_TYPE_IWLAN
public static final int NETWORK_TYPE_LTE_CA
public static final int NETWORK_CLASS_UNKNOWN
public static final int NETWORK_CLASS_2_G
public static final int NETWORK_CLASS_3_G
public static final int NETWORK_CLASS_4_G
public static final int SIM_STATE_UNKNOWN
public static final int SIM_STATE_ABSENT
public static final int SIM_STATE_PIN_REQUIRED
public static final int SIM_STATE_PUK_REQUIRED
public static final int SIM_STATE_NETWORK_LOCKED
public static final int SIM_STATE_READY
public static final int SIM_STATE_NOT_READY
public static final int SIM_STATE_PERM_DISABLED
public static final int SIM_STATE_CARD_IO_ERROR
public static final int SIM_STATE_CARD_RESTRICTED
public static final int CALL_STATE_IDLE
public static final int CALL_STATE_RINGING
public static final int CALL_STATE_OFFHOOK
public static final int DATA_ACTIVITY_NONE
public static final int DATA_ACTIVITY_IN
public static final int DATA_ACTIVITY_OUT
public static final int DATA_ACTIVITY_INOUT
public static final int DATA_ACTIVITY_DORMANT
public static final int DATA_UNKNOWN
public static final int DATA_DISCONNECTED
public static final int DATA_CONNECTING
public static final int DATA_CONNECTED
public static final int DATA_SUSPENDED
public static final int APPTYPE_SIM
public static final int APPTYPE_USIM
public static final int APPTYPE_RUIM
public static final int APPTYPE_CSIM
public static final int APPTYPE_ISIM
public static final int AUTHTYPE_EAP_SIM
public static final int AUTHTYPE_EAP_AKA
public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS
public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS
public static final int CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED
public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES
public TelephonyManager(Context context)
public TelephonyManager(Context context, int subId)
public static TelephonyManager getDefault()
public TelephonyManager.MultiSimVariants getMultiSimConfiguration()
public int getPhoneCount()
public static TelephonyManager from(Context context)
public TelephonyManager createForSubscriptionId(int subId)
public boolean isMultiSimEnabled()
public String getDeviceSoftwareVersion()
Requires Permission:
READ_PHONE_STATE
public String getDeviceSoftwareVersion(int slotId)
public String getDeviceId()
Requires Permission:
READ_PHONE_STATE
public String getDeviceId(int slotId)
Requires Permission:
READ_PHONE_STATE
slotId
- of which deviceID is returnedpublic String getImei()
public String getImei(int slotId)
public String getNai()
public String getNai(int slotId)
public CellLocation getCellLocation()
If there is only one radio in the device and that radio has an LTE connection, this method will return null. The implementation must not to try add LTE identifiers into the existing cdma/gsm classes.
In the future this call will be deprecated.
Requires Permission:
ACCESS_COARSE_LOCATION
or
ACCESS_FINE_LOCATION
.
public void enableLocationUpdates()
PhoneStateListener.onCellLocationChanged
will be called on location updates.
Requires Permission: CONTROL_LOCATION_UPDATES
public void enableLocationUpdates(int subId)
PhoneStateListener.onCellLocationChanged
will be called on location updates.
Requires Permission: CONTROL_LOCATION_UPDATES
subId
- for which the location updates are enabledpublic void disableLocationUpdates()
PhoneStateListener.onCellLocationChanged
will be called on location updates.
Requires Permission: CONTROL_LOCATION_UPDATES
public void disableLocationUpdates(int subId)
@Deprecated public List<NeighboringCellInfo> getNeighboringCellInfo()
Requires Permission: (@link android.Manifest.permission#ACCESS_COARSE_UPDATES}
public int getCurrentPhoneType()
PHONE_TYPE_NONE
,
PHONE_TYPE_GSM
,
PHONE_TYPE_CDMA
,
{@hide}
public int getCurrentPhoneType(int subId)
subId
- for which phone type is returnedPHONE_TYPE_NONE
,
PHONE_TYPE_GSM
,
PHONE_TYPE_CDMA
public int getCurrentPhoneTypeForSlot(int slotId)
public int getPhoneType()
PHONE_TYPE_NONE
,
PHONE_TYPE_GSM
,
PHONE_TYPE_CDMA
,
PHONE_TYPE_SIP
public static int getPhoneType(int networkMode)
networkMode
- public static int getLteOnCdmaModeStatic()
public String getNetworkOperatorName()
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use getPhoneType()
to determine if
on a CDMA network).
public String getNetworkOperatorName(int subId)
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use getPhoneType()
to determine if
on a CDMA network).
subId
- public String getNetworkOperator()
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use getPhoneType()
to determine if
on a CDMA network).
public String getNetworkOperator(int subId)
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use getPhoneType()
to determine if
on a CDMA network).
subId
- public String getNetworkOperatorForPhone(int phoneId)
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use getPhoneType()
to determine if
on a CDMA network).
phoneId
- public boolean isNetworkRoaming()
Availability: Only when user registered to a network.
public boolean isNetworkRoaming(int subId)
Availability: Only when user registered to a network.
subId
- public String getNetworkCountryIso()
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use getPhoneType()
to determine if
on a CDMA network).
public String getNetworkCountryIso(int subId)
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use getPhoneType()
to determine if
on a CDMA network).
subId
- for which Network CountryIso is returnedpublic String getNetworkCountryIsoForPhone(int phoneId)
public int getNetworkType()
public int getNetworkType(int subId)
subId
- for which network type is returnedNETWORK_TYPE_UNKNOWN
,
NETWORK_TYPE_GPRS
,
NETWORK_TYPE_EDGE
,
NETWORK_TYPE_UMTS
,
NETWORK_TYPE_HSDPA
,
NETWORK_TYPE_HSUPA
,
NETWORK_TYPE_HSPA
,
NETWORK_TYPE_CDMA
,
NETWORK_TYPE_EVDO_0
,
NETWORK_TYPE_EVDO_A
,
NETWORK_TYPE_EVDO_B
,
NETWORK_TYPE_1xRTT
,
NETWORK_TYPE_IDEN
,
NETWORK_TYPE_LTE
,
NETWORK_TYPE_EHRPD
,
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
public int getDataNetworkType()
NETWORK_TYPE_UNKNOWN
,
NETWORK_TYPE_GPRS
,
NETWORK_TYPE_EDGE
,
NETWORK_TYPE_UMTS
,
NETWORK_TYPE_HSDPA
,
NETWORK_TYPE_HSUPA
,
NETWORK_TYPE_HSPA
,
NETWORK_TYPE_CDMA
,
NETWORK_TYPE_EVDO_0
,
NETWORK_TYPE_EVDO_A
,
NETWORK_TYPE_EVDO_B
,
NETWORK_TYPE_1xRTT
,
NETWORK_TYPE_IDEN
,
NETWORK_TYPE_LTE
,
NETWORK_TYPE_EHRPD
,
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
public int getDataNetworkType(int subId)
subId
- for which network type is returned
Requires Permission:
READ_PHONE_STATE
public int getVoiceNetworkType()
Requires Permission:
READ_PHONE_STATE
public int getVoiceNetworkType(int subId)
Requires Permission:
READ_PHONE_STATE
public static int getNetworkClass(int networkType)
public String getNetworkTypeName()
public static String getNetworkTypeName(int type)
public boolean hasIccCard()
public boolean hasIccCard(int slotId)
public int getSimState()
public int getSimState(int slotIdx)
public String getSimOperator()
Availability: SIM state must be SIM_STATE_READY
getSimState()
public String getSimOperator(int subId)
Availability: SIM state must be SIM_STATE_READY
subId
- for which SimOperator is returnedgetSimState()
public String getSimOperatorNumeric()
Availability: SIM state must be SIM_STATE_READY
getSimState()
public String getSimOperatorNumeric(int subId)
Availability: SIM state must be SIM_STATE_READY
subId
- for which SimOperator is returnedgetSimState()
public String getSimOperatorNumericForPhone(int phoneId)
phoneId
- for which SimOperator is returnedpublic String getSimOperatorName()
Availability: SIM state must be SIM_STATE_READY
getSimState()
public String getSimOperatorName(int subId)
Availability: SIM state must be SIM_STATE_READY
subId
- for which SimOperatorName is returnedgetSimState()
public String getSimOperatorNameForPhone(int phoneId)
public String getSimCountryIso()
public String getSimCountryIso(int subId)
subId
- for which SimCountryIso is returnedpublic String getSimCountryIsoForPhone(int phoneId)
public String getSimSerialNumber()
Requires Permission:
READ_PHONE_STATE
public String getSimSerialNumber(int subId)
subId
- for which Sim Serial number is returned
Requires Permission:
READ_PHONE_STATE
public int getLteOnCdmaMode()
PhoneConstants.LTE_ON_CDMA_UNKNOWN
, PhoneConstants.LTE_ON_CDMA_FALSE
or PhoneConstants.LTE_ON_CDMA_TRUE
Requires Permission:
READ_PHONE_STATE
public int getLteOnCdmaMode(int subId)
subId
- for which radio is LTE on CDMA is returnedPhoneConstants.LTE_ON_CDMA_UNKNOWN
, PhoneConstants.LTE_ON_CDMA_FALSE
or PhoneConstants.LTE_ON_CDMA_TRUE
Requires Permission:
READ_PHONE_STATE
public String getSubscriberId()
Requires Permission:
READ_PHONE_STATE
public String getSubscriberId(int subId)
Requires Permission:
READ_PHONE_STATE
subId
- whose subscriber id is returnedpublic String getGroupIdLevel1()
Requires Permission:
READ_PHONE_STATE
public String getGroupIdLevel1(int subId)
Requires Permission:
READ_PHONE_STATE
subId
- whose subscriber id is returnedpublic String getLine1Number()
Requires Permission:
READ_PHONE_STATE
OR
android.Manifest.permission#READ_SMS
The default SMS app can also use this.
public String getLine1Number(int subId)
Requires Permission:
READ_PHONE_STATE
OR
android.Manifest.permission#READ_SMS
The default SMS app can also use this.
subId
- whose phone number for line 1 is returnedpublic boolean setLine1NumberForDisplay(String alphaTag, String number)
Requires that the calling app has carrier privileges.
alphaTag
- alpha-tagging of the dailing nubmernumber
- The dialing numberhasCarrierPrivileges()
public boolean setLine1NumberForDisplay(int subId, String alphaTag, String number)
Requires that the calling app has carrier privileges.
subId
- the subscriber that the alphatag and dialing number belongs to.alphaTag
- alpha-tagging of the dailing nubmernumber
- The dialing numberhasCarrierPrivileges()
public String getLine1AlphaTag()
Requires Permission:
READ_PHONE_STATE
public String getLine1AlphaTag(int subId)
Requires Permission:
READ_PHONE_STATE
subId
- whose alphabetic identifier associated with line 1 is returned
nobody seems to call this.public String[] getMergedSubscriberIds()
null
to
indicate no merging is required. Any returned subscribers are sorted in a
deterministic order.public String getMsisdn()
Requires Permission:
READ_PHONE_STATE
public String getMsisdn(int subId)
Requires Permission:
READ_PHONE_STATE
subId
- for which msisdn is returnedpublic String getVoiceMailNumber()
Requires Permission:
READ_PHONE_STATE
public String getVoiceMailNumber(int subId)
Requires Permission:
READ_PHONE_STATE
subId
- whose voice mail number is returnedpublic String getCompleteVoiceMailNumber()
Requires Permission:
CALL_PRIVILEGED
public String getCompleteVoiceMailNumber(int subId)
Requires Permission:
CALL_PRIVILEGED
subId
- public boolean setVoiceMailNumber(String alphaTag, String number)
Requires that the calling app has carrier privileges.
alphaTag
- The alpha tag to display.number
- The voicemail number.hasCarrierPrivileges()
public boolean setVoiceMailNumber(int subId, String alphaTag, String number)
Requires that the calling app has carrier privileges.
subId
- The subscription id.alphaTag
- The alpha tag to display.number
- The voicemail number.hasCarrierPrivileges()
public void setVisualVoicemailEnabled(PhoneAccountHandle phoneAccountHandle, boolean enabled)
Requires that the calling app is the default dialer, or has carrier privileges, or
has permission MODIFY_PHONE_STATE
.
phoneAccountHandle
- the phone account to change the client stateenabled
- the new state of the clienthasCarrierPrivileges()
public boolean isVisualVoicemailEnabled(PhoneAccountHandle phoneAccountHandle)
Requires Permission:
READ_PHONE_STATE
phoneAccountHandle
- the phone account to check for.true
when the visual voicemail client is enabled for this clientpublic void enableVisualVoicemailSmsFilter(int subId, VisualVoicemailSmsFilterSettings settings)
public void disableVisualVoicemailSmsFilter(int subId)
public VisualVoicemailSmsFilterSettings getVisualVoicemailSmsFilterSettings(int subId)
public VisualVoicemailSmsFilterSettings getVisualVoicemailSmsFilterSettings(String packageName, int subId)
public int getVoiceMessageCount()
Requires Permission:
READ_PHONE_STATE
public int getVoiceMessageCount(int subId)
Requires Permission:
READ_PHONE_STATE
subId
- whose voice message count is returnedpublic String getVoiceMailAlphaTag()
Requires Permission:
READ_PHONE_STATE
public String getVoiceMailAlphaTag(int subId)
Requires Permission:
READ_PHONE_STATE
subId
- whose alphabetic identifier associated with the
voice mail number is returnedpublic String getIsimImpi()
public String getIsimDomain()
public String[] getIsimImpu()
public int getCallState()
CALL_STATE_RINGING
CALL_STATE_OFFHOOK
CALL_STATE_IDLE
public int getCallState(int subId)
subId
- whose call state is returnedpublic int getCallStateForSlot(int slotId)
public int getDataActivity()
public int getDataState()
DATA_DISCONNECTED
,
DATA_CONNECTING
,
DATA_CONNECTED
,
DATA_SUSPENDED
public void listen(PhoneStateListener listener, int events)
To register a listener, pass a PhoneStateListener
and specify at least one telephony state of interest in
the events argument.
At registration, and when a specified telephony state
changes, the telephony manager invokes the appropriate
callback method on the listener object and passes the
current (updated) values.
To unregister a listener, pass the listener object and set the
events argument to
LISTEN_NONE
(0).
listener
- The PhoneStateListener
object to register
(or unregister)events
- The telephony state(s) of interest to the listener,
as a bitwise-OR combination of PhoneStateListener
LISTEN_ flags.public int getCdmaEriIconIndex()
Requires Permission:
READ_PHONE_STATE
public int getCdmaEriIconIndex(int subId)
Requires Permission:
READ_PHONE_STATE
public int getCdmaEriIconMode()
Requires Permission:
READ_PHONE_STATE
public int getCdmaEriIconMode(int subId)
Requires Permission:
READ_PHONE_STATE
public String getCdmaEriText()
Requires Permission:
READ_PHONE_STATE
public String getCdmaEriText(int subId)
Requires Permission:
READ_PHONE_STATE
public boolean isVoiceCapable()
"Voice capable" means that this device supports circuit-switched (i.e. voice) phone calls over the telephony network, and is allowed to display the in-call UI while a cellular voice call is active. This will be false on "data only" devices which can't make voice calls and don't support any in-call UI.
Note: the meaning of this flag is subtly different from the PackageManager.FEATURE_TELEPHONY system feature, which is available on any device with a telephony radio, even if the device is data-only.
public boolean isSmsCapable()
If true, this means that the device supports both sending and receiving sms via the telephony network.
Note: Voicemail waiting sms, cell broadcasting sms, and MMS are disabled when device doesn't support sms.
public List<CellInfo> getAllCellInfo()
onCellInfoChanged()
, or change the rate at which
onCellInfoChanged()
is called.
The list can include one or more CellInfoGsm
,
CellInfoCdma
,
CellInfoLte
, and
CellInfoWcdma
objects, in any combination.
On devices with multiple radios it is typical to see instances of
one or more of any these in the list. In addition, zero, one, or more
of the returned objects may be considered registered; that is, their
CellInfo.isRegistered()
methods may return true.
This method returns valid data for registered cells on devices with
PackageManager.FEATURE_TELEPHONY
.
This method is preferred over using getCellLocation()
.
However, for older devices, getAllCellInfo()
may return
null. In these cases, you should call getCellLocation()
instead.
Requires permission:
android.Manifest.permission#ACCESS_COARSE_LOCATION
CellInfo
; null if cell
information is unavailable.public void setCellInfoListRate(int rateInMillis)
PhoneStateListener.onCellInfoChanged
will be invoked.
The default, 0, means invoke onCellInfoChanged when any of the reported information changes. Setting the value to INT_MAX(0x7fffffff) means never issue A onCellInfoChanged.
rateInMillis
- the ratepublic String getMmsUserAgent()
public String getMmsUAProfUrl()
public IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
AID
- Application id. See ETSI 102.221 and 101.220.public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
subId
- The subscription to use.AID
- Application id. See ETSI 102.221 and 101.220.public boolean iccCloseLogicalChannel(int channel)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
channel
- is the channel id to be closed as retruned by a successful
iccOpenLogicalChannel.public boolean iccCloseLogicalChannel(int subId, int channel)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
subId
- The subscription to use.channel
- is the channel id to be closed as retruned by a successful
iccOpenLogicalChannel.public String iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
channel
- is the channel id to be closed as returned by a successful
iccOpenLogicalChannel.cla
- Class of the APDU command.instruction
- Instruction of the APDU command.p1
- P1 value of the APDU command.p2
- P2 value of the APDU command.p3
- P3 value of the APDU command. If p3 is negative a 4 byte APDU
is sent to the SIM.data
- Data to be sent with the APDU.public String iccTransmitApduLogicalChannel(int subId, int channel, int cla, int instruction, int p1, int p2, int p3, String data)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
subId
- The subscription to use.channel
- is the channel id to be closed as returned by a successful
iccOpenLogicalChannel.cla
- Class of the APDU command.instruction
- Instruction of the APDU command.p1
- P1 value of the APDU command.p2
- P2 value of the APDU command.p3
- P3 value of the APDU command. If p3 is negative a 4 byte APDU
is sent to the SIM.data
- Data to be sent with the APDU.public String iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, String data)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
cla
- Class of the APDU command.instruction
- Instruction of the APDU command.p1
- P1 value of the APDU command.p2
- P2 value of the APDU command.p3
- P3 value of the APDU command. If p3 is negative a 4 byte APDU
is sent to the SIM.data
- Data to be sent with the APDU.public String iccTransmitApduBasicChannel(int subId, int cla, int instruction, int p1, int p2, int p3, String data)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
subId
- The subscription to use.cla
- Class of the APDU command.instruction
- Instruction of the APDU command.p1
- P1 value of the APDU command.p2
- P2 value of the APDU command.p3
- P3 value of the APDU command. If p3 is negative a 4 byte APDU
is sent to the SIM.data
- Data to be sent with the APDU.public byte[] iccExchangeSimIO(int fileID, int command, int p1, int p2, int p3, String filePath)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
fileID
- command
- p1
- P1 value of the APDU command.p2
- P2 value of the APDU command.p3
- P3 value of the APDU command.filePath
- public byte[] iccExchangeSimIO(int subId, int fileID, int command, int p1, int p2, int p3, String filePath)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
subId
- The subscription to use.fileID
- command
- p1
- P1 value of the APDU command.p2
- P2 value of the APDU command.p3
- P3 value of the APDU command.filePath
- public String sendEnvelopeWithStatus(String content)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
content
- String containing SAT/USAT response in hexadecimal
format starting with command tag. See TS 102 223 for
details.public String sendEnvelopeWithStatus(int subId, String content)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
subId
- The subscription to use.content
- String containing SAT/USAT response in hexadecimal
format starting with command tag. See TS 102 223 for
details.public String nvReadItem(int itemID)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
itemID
- the ID of the item to read.public boolean nvWriteItem(int itemID, String itemValue)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
itemID
- the ID of the item to read.itemValue
- the value to write, as a String.public boolean nvWriteCdmaPrl(byte[] preferredRoamingList)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
preferredRoamingList
- byte array containing the new PRL.public boolean nvResetConfig(int resetType)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
resetType
- reset type: 1: reload NV reset, 2: erase NV reset, 3: factory NV resetpublic int getDefaultSim()
public static void setTelephonyProperty(int phoneId, String property, String value)
public static int getIntAtIndex(ContentResolver cr, String name, int index) throws Settings.SettingNotFoundException
This version does not take a default value. If the setting has not
been set, or the string value is not a number,
it throws Settings.SettingNotFoundException
.
cr
- The ContentResolver to access.name
- The name of the setting to retrieve.index
- The index of the listSettings.SettingNotFoundException
- Thrown if a setting by the given
name can't be found or the setting value is not an integer.public static boolean putIntAtIndex(ContentResolver cr, String name, int index, int value)
cr
- The ContentResolver to access.name
- The name of the setting to modify.index
- The index of the listvalue
- The new value for the setting to be added to the list.public static String getTelephonyProperty(int phoneId, String property, String defaultVal)
public int getSimCount()
public String getIsimIst()
public String[] getIsimPcscf()
public String getIsimChallengeResponse(String nonce)
with appType=PhoneConstants.APPTYPE_ISIM
public String getIccAuthentication(int appType, int authType, String data)
Requires that the calling app has carrier privileges or READ_PRIVILEGED_PHONE_STATE permission.
appType
- the icc application type, like APPTYPE_USIM
authType
- the authentication type, AUTHTYPE_EAP_AKA
or
AUTHTYPE_EAP_SIM
data
- authentication challenge data, base64 encoded.
See 3GPP TS 31.102 7.1.2 for more details.hasCarrierPrivileges()
public String getIccAuthentication(int subId, int appType, int authType, String data)
Requires that the calling app has carrier privileges.
subId
- subscription ID used for authenticationappType
- the icc application type, like APPTYPE_USIM
authType
- the authentication type, AUTHTYPE_EAP_AKA
or
AUTHTYPE_EAP_SIM
data
- authentication challenge data, base64 encoded.
See 3GPP TS 31.102 7.1.2 for more details.hasCarrierPrivileges()
public String[] getPcscfAddress(String apnType)
apnType
- the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APNpublic void setImsRegistrationState(boolean registered)
Registration
- statepublic int getPreferredNetworkType(int subId)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
public void setNetworkSelectionModeAutomatic(int subId)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
public CellNetworkScanResult getCellNetworkScanResults(int subId)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
public boolean setNetworkSelectionModeManual(int subId, OperatorInfo operator, boolean persistSelection)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
public boolean setPreferredNetworkType(int subId, int networkType)
Requires Permission:
MODIFY_PHONE_STATE
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
subId
- the id of the subscription to set the preferred network type for.networkType
- the preferred network type, defined in RILConstants.java.public boolean setPreferredNetworkTypeToGlobal()
Requires that the calling app has carrier privileges.
hasCarrierPrivileges()
public boolean setPreferredNetworkTypeToGlobal(int subId)
Requires that the calling app has carrier privileges.
hasCarrierPrivileges()
public int getTetherApnRequired()
public boolean hasCarrierPrivileges()
public boolean hasCarrierPrivileges(int subId)
subId
- The subscription to use.public boolean setOperatorBrandOverride(String brand)
Requires that the calling app has carrier privileges.
brand
- The brand name to display/set.hasCarrierPrivileges()
public boolean setOperatorBrandOverride(int subId, String brand)
Requires that the calling app has carrier privileges.
subId
- The subscription to use.brand
- The brand name to display/set.hasCarrierPrivileges()
public boolean setRoamingOverride(List<String> gsmRoamingList, List<String> gsmNonRoamingList, List<String> cdmaRoamingList, List<String> cdmaNonRoamingList)
Requires that the caller have carrier privilege. See #hasCarrierPrivileges.
gsmRoamingList
- - List of MCCMNCs to be considered roaming for 3GPP RATs.gsmNonRoamingList
- - List of MCCMNCs to be considered not roaming for 3GPP RATs.cdmaRoamingList
- - List of SIDs to be considered roaming for 3GPP2 RATs.cdmaNonRoamingList
- - List of SIDs to be considered not roaming for 3GPP2 RATs.public boolean setRoamingOverride(int subId, List<String> gsmRoamingList, List<String> gsmNonRoamingList, List<String> cdmaRoamingList, List<String> cdmaNonRoamingList)
Requires that the caller have carrier privilege. See #hasCarrierPrivileges.
subId
- for which the roaming overrides apply.gsmRoamingList
- - List of MCCMNCs to be considered roaming for 3GPP RATs.gsmNonRoamingList
- - List of MCCMNCs to be considered not roaming for 3GPP RATs.cdmaRoamingList
- - List of SIDs to be considered roaming for 3GPP2 RATs.cdmaNonRoamingList
- - List of SIDs to be considered not roaming for 3GPP2 RATs.public String getCdmaMdn()
public String getCdmaMdn(int subId)
public String getCdmaMin()
public String getCdmaMin(int subId)
public int checkCarrierPrivilegesForPackage(String pkgName)
public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName)
public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId)
public void dial(String number)
public boolean endCall()
public void answerRingingCall()
public void silenceRinger()
public boolean isOffhook()
public boolean isRinging()
public boolean isIdle()
public boolean isRadioOn()
public boolean supplyPin(String pin)
public int[] supplyPinReportResult(String pin)
public boolean handlePinMmi(String dialString)
public boolean handlePinMmiForSubscriber(int subId, String dialString)
public void toggleRadioOnOff()
public boolean setRadio(boolean turnOn)
public boolean setRadioPower(boolean turnOn)
public void updateServiceLocation()
public boolean enableDataConnectivity()
public boolean disableDataConnectivity()
public boolean isDataConnectivityPossible()
public boolean needsOtaServiceProvisioning()
public void setDataEnabled(boolean enable)
public void setDataEnabled(int subId, boolean enable)
public boolean getDataEnabled()
public boolean getDataEnabled(int subId)
public int invokeOemRilRequestRaw(byte[] oemReq, byte[] oemResp)
oemReq
- the data is sent to ril.oemResp
- the respose data from RIL.public void enableVideoCalling(boolean enable)
public boolean isVideoCallingEnabled()
public boolean canChangeDtmfToneLength()
true
if the DTMF tone length can be changed, and false
otherwise.public boolean isWorldPhone()
true
if the device is a world phone, and false
otherwise.public boolean isTtyModeSupported()
true
if the device supports TTY mode, and false
otherwise.public boolean isHearingAidCompatibilitySupported()
true
if the device supports hearing aid compatibility, and false
otherwise.public static int getIntWithSubId(ContentResolver cr, String name, int subId) throws Settings.SettingNotFoundException
public boolean isImsRegistered()
public boolean isVolteAvailable()
public boolean isVideoTelephonyAvailable()
public boolean isWifiCallingAvailable()
public void setSimOperatorNumeric(String numeric)
public void setSimOperatorNumericForPhone(int phoneId, String numeric)
public void setSimOperatorName(String name)
public void setSimOperatorNameForPhone(int phoneId, String name)
public void setSimCountryIso(String iso)
public void setSimCountryIsoForPhone(int phoneId, String iso)
public void setSimState(String state)
public void setSimStateForPhone(int phoneId, String state)
public void setBasebandVersion(String version)
version
- baseband versionpublic void setBasebandVersionForPhone(int phoneId, String version)
phoneId
- for which baseband version is setversion
- baseband versionpublic void setPhoneType(int type)
type
- phone typepublic void setPhoneType(int phoneId, int type)
phoneId
- for which phone type is settype
- phone typepublic String getOtaSpNumberSchema(String defaultValue)
defaultValue
- default valuepublic String getOtaSpNumberSchemaForPhone(int phoneId, String defaultValue)
phoneId
- for which OTA SP number schema is getdefaultValue
- default valuepublic boolean getSmsReceiveCapable(boolean defaultValue)
defaultValue
- default valuepublic boolean getSmsReceiveCapableForPhone(int phoneId, boolean defaultValue)
phoneId
- for which SMS receive capable is getdefaultValue
- default valuepublic boolean getSmsSendCapable(boolean defaultValue)
defaultValue
- default valuepublic boolean getSmsSendCapableForPhone(int phoneId, boolean defaultValue)
phoneId
- for which SMS send capable is getdefaultValue
- default valuepublic void setNetworkOperatorName(String name)
name
- the alphabetic name of current registered operator.public void setNetworkOperatorNameForPhone(int phoneId, String name)
phoneId
- which phone you want to setname
- the alphabetic name of current registered operator.public void setNetworkOperatorNumeric(String numeric)
operator
- the numeric name (MCC+MNC) of current registered operatorpublic void setNetworkOperatorNumericForPhone(int phoneId, String numeric)
phoneId
- for which phone type is setoperator
- the numeric name (MCC+MNC) of current registered operatorpublic void setNetworkRoaming(boolean isRoaming)
isRoaming
- is network in romaing state or notpublic void setNetworkRoamingForPhone(int phoneId, boolean isRoaming)
phoneId
- which phone you want to setisRoaming
- is network in romaing state or notpublic void setNetworkCountryIso(String iso)
iso
- the ISO country code equivalent of the current registeredpublic void setNetworkCountryIsoForPhone(int phoneId, String iso)
phoneId
- which phone you want to setiso
- the ISO country code equivalent of the current registeredpublic void setDataNetworkType(int type)
type
- the network type currently in use on the device for data transmissionpublic void setDataNetworkTypeForPhone(int phoneId, int type)
phoneId
- which phone you want to settype
- the network type currently in use on the device for data transmissionpublic int getSubIdForPhoneAccount(PhoneAccount phoneAccount)
public void factoryReset(int subId)
public String getLocaleFromDefaultSim()
public void requestModemActivityInfo(ResultReceiver result)
result
- The object on which the recipient will send the resulting
ModemActivityInfo
object.public ServiceState getServiceStateForSubscriber(int subId)
public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle)
accountHandle
- The handle for the PhoneAccount
for which to retrieve the
voicemail ringtone.public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle)
accountHandle
- The handle for the PhoneAccount
for which to retrieve the
voicemail vibration setting.true
if the vibration is set for this PhoneAccount, false
otherwise.public String getAidForAppType(int appType)
APPTYPE_CSIM
.
Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permissionappType
- the uicc app type like APPTYPE_CSIM
public String getAidForAppType(int subId, int appType)
APPTYPE_CSIM
.
Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permissionsubId
- the subscription ID that this request applies to.appType
- the uicc app type, like APPTYPE_CSIM
public String getEsn()
public String getEsn(int subId)
subId
- the subscription ID that this request applies to.public String getCdmaPrlVersion()
public String getCdmaPrlVersion(int subId)
subId
- the subscription ID that this request applies to.public List<TelephonyHistogram> getTelephonyHistograms()
MODIFY_PHONE_STATE
Or the calling app has carrier privileges.public int setAllowedCarriers(int slotId, List<CarrierIdentifier> carriers)
public List<CarrierIdentifier> getAllowedCarriers(int slotId)
android.telephony.CarrierIdentifier
; empty list
means all carriers are allowed.public void carrierActionSetMeteredApnsEnabled(int subId, boolean enabled)
subId
- the subscription ID that this action applies to.enabled
- control enable or disable metered apns.public void carrierActionSetRadioEnabled(int subId, boolean enabled)
subId
- the subscription ID that this action applies to.enabled
- control enable or disable radio.public long getVtDataUsage()
public void setPolicyDataEnabled(boolean enabled, int subId)
enabled
- True if enabling the data, otherwise disabling.subId
- sub id