TelephonyManager
open class TelephonyManager
kotlin.Any | |
↳ | android.telephony.TelephonyManager |
Provides access to information about the telephony services on the device. Applications can use the methods in this class to determine telephony services and states, as well as to access some types of subscriber information. Applications can also register a listener to receive notification of telephony state changes.
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.
TelephonyManager is intended for use on devices that implement FEATURE_TELEPHONY
. On devices that do not implement this feature, the behavior is not reliable.
Requires the PackageManager#FEATURE_TELEPHONY
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Summary
Nested classes | |
---|---|
open |
Exception that may be supplied to the callback in #uploadCallComposerPicture if something goes awry. |
abstract |
Callback for providing asynchronous |
open |
Exception that is supplied to the callback in |
open |
Exception that may be supplied to the callback in |
open |
Exception that is supplied to the callback in |
abstract |
Used to notify callers of |
Constants | |
---|---|
static String |
A service action that identifies a |
static String |
Broadcast action sent when the availability of the system default network changes. |
static String |
Broadcast action sent when a PCO value becomes available from the modem. |
static String |
Broadcast action sent when a data connection is redirected with validation failure. |
static String |
Broadcast action sent when a data connection setup fails. |
static String |
Broadcast action sent when carrier apps should reset their internal state. |
static String |
Open the voicemail settings activity to make changes to voicemail configuration. |
static String |
Broadcast action to be received by Broadcast receivers. |
static String |
Broadcast intent action for network country code changes. |
static String |
Broadcast intent action indicating that the call state on the device has changed. |
static String |
Activity action: Show setting to reset mobile networks. |
static String |
The Phone app sends this intent when a user opts to respond-via-message during an incoming call. |
static String |
Broadcast Action: A debug code has been entered in the dialer. |
static String |
Broadcast intent action for letting the default dialer to know to show voicemail notification. |
static String |
Broadcast Action: The subscription carrier identity has changed. |
static String |
Broadcast Action: The subscription specific carrier identity has changed. |
static Int |
To indicate allowed network type change is requested by carrier. |
static Int |
To indicate allowed network type change is requested by user. |
static Int |
UICC application type is CSIM |
static Int |
UICC application type is ISIM |
static Int |
UICC application type is RUIM |
static Int |
UICC application type is SIM |
static Int |
UICC application type is unknown or not specified |
static Int |
UICC application type is USIM |
static Int |
Authentication type for UICC challenge is EAP AKA. |
static Int |
Authentication type for UICC challenge is EAP SIM. |
static Int |
Authentication type for GBA Bootstrap Challenge. |
static Int |
Authentication type for GBA Network Application Functions (NAF) key External Challenge. |
static Int |
Call composer status Business Only from user setting. |
static Int |
Call composer status OFF from user setting. |
static Int |
Call composer status ON from user setting. |
static Int |
Device call state: No activity. |
static Int |
Device call state: Off-hook. |
static Int |
Device call state: Ringing. |
static String |
Indicates whether |
static Int |
The device is not restricted to a carrier |
static Int |
The device is restricted to a carrier. |
static Int |
The device is restricted to the carrier of the calling application. |
static Int |
Carrier restriction status value is unknown, in case modem did not provide any information about carrier restriction status. |
static Int |
Value for |
static Int |
Value for |
static Int |
Value for |
static Int |
Value for |
static Int |
Data connection is active, but physical link is down |
static Int |
Data connection activity: Currently receiving IP PPP traffic. |
static Int |
Data connection activity: Currently both sending and receiving IP PPP traffic. |
static Int |
Data connection activity: No traffic. |
static Int |
Data connection activity: Currently sending IP PPP traffic. |
static Int |
Data connection state: Connected. |
static Int |
Data connection state: Currently setting up a data connection. |
static Int |
Data connection state: Disconnected. |
static Int |
Data connection state: Disconnecting. |
static Int |
To indicate enable or disable carrier data by the system based on carrier signalling or carrier privileged apps. |
static Int |
To indicate data was enabled or disabled due to mobile data policy overrides. |
static Int |
To indicate that data control due to policy. |
static Int |
To indicate enable or disable data by thermal service. |
static Int |
To indicate that data was enabled or disabled due to an unknown reason. |
static Int |
To indicate that user enabled or disabled data. |
static Int |
Data connection state: Handover in progress. |
static Int |
Data connection state: Suspended. |
static Int |
Data connection state: Unknown. |
static Int |
Default port index for a UICC. |
static Int |
ERI (Enhanced Roaming Indicator) is FLASH i. |
static Int |
ERI (Enhanced Roaming Indicator) is OFF i. |
static Int |
ERI (Enhanced Roaming Indicator) is ON i. |
static String |
Event reported from the Telephony stack to indicate that the |
static String |
The number of active SIM supported by current multi-SIM config. |
static String |
An integer extra containing the protocol of the apn connection. |
static String |
An integer extra containing the APN type. |
static String |
The intent to call voicemail. |
static String |
An int extra used with |
static String |
An string extra used with |
static String |
An integer extra containing the data fail cause. |
static String |
A boolean extra indicating the availability of the default network. |
static String |
Integer extra key used with |
static String |
Extra key used with the |
static String |
The boolean value indicating whether the voicemail settings activity launched by |
static String |
Extra key used with the |
static String |
Boolean value representing whether the |
static String |
The extra used with an |
static String |
The intent to launch voicemail settings. |
static String |
The extra used with an |
static String |
The number of voice messages associated with the notification. |
static String |
An integer extra indicating the ID for the PCO data. |
static String |
A byte array extra containing PCO data read from the modem. |
static String |
The extra used with an |
static String |
String extra containing the redirection URL sent with |
static String |
An int extra used with |
static String |
An string extra used with |
static String |
The lookup key used with the |
static String |
An int extra used with |
static String |
The voicemail number. |
static Int |
Include coarse location data. |
static Int |
Include fine location data. |
static Int |
Specifies to not include any location related data. |
static String |
A boolean meta-data value indicating whether the voicemail settings should be hidden in the call settings page launched by |
static Int |
The usage of multiple SIM cards at the same time to register on the network (e.g. Dual Standby or Dual Active) is supported. |
static Int |
The usage of multiple SIM cards at the same time to register on the network (e.g. Dual Standby or Dual Active) is supported by the hardware, but restricted by the carrier. |
static Int |
The usage of multiple SIM cards at the same time to register on the network (e.g. Dual Standby or Dual Active) is not supported by the hardware. |
static Int | |
static Int | |
static Int | |
static Int |
Current network is 1xRTT |
static Long |
network type bitmask indicating the support of radio tech 1xRTT. |
static Long |
network type bitmask indicating the support of radio tech CDMA(IS95A/IS95B). |
static Long |
network type bitmask indicating the support of radio tech EDGE. |
static Long |
network type bitmask indicating the support of radio tech EHRPD. |
static Long |
network type bitmask indicating the support of radio tech EVDO 0. |
static Long |
network type bitmask indicating the support of radio tech EVDO A. |
static Long |
network type bitmask indicating the support of radio tech EVDO B. |
static Long |
network type bitmask indicating the support of radio tech GPRS. |
static Long |
network type bitmask indicating the support of radio tech GSM. |
static Long |
network type bitmask indicating the support of radio tech HSDPA. |
static Long |
network type bitmask indicating the support of radio tech HSPA. |
static Long |
network type bitmask indicating the support of radio tech HSPAP. |
static Long |
network type bitmask indicating the support of radio tech HSUPA. |
static Long |
network type bitmask indicating the support of radio tech IWLAN. |
static Long |
network type bitmask indicating the support of radio tech LTE. |
static Long |
NOT USED; this bitmask is exposed accidentally. |
static Long |
network type bitmask indicating the support of radio tech NR(New Radio) 5G. |
static Long |
network type bitmask indicating the support of radio tech TD_SCDMA. |
static Long |
network type bitmask indicating the support of radio tech UMTS. |
static Long |
network type bitmask unknown. |
static Int |
Current network is CDMA: Either IS95A or IS95B |
static Int |
Current network is EDGE |
static Int |
Current network is eHRPD |
static Int |
Current network is EVDO revision 0 |
static Int |
Current network is EVDO revision A |
static Int |
Current network is EVDO revision B |
static Int |
Current network is GPRS |
static Int |
Current network is GSM |
static Int |
Current network is HSDPA |
static Int |
Current network is HSPA |
static Int |
Current network is HSPA+ |
static Int |
Current network is HSUPA |
static Int |
Current network is iDen |
static Int |
Current network is IWLAN |
static Int |
Current network is LTE |
static Int |
Current network is NR (New Radio) 5G. |
static Int |
Current network is TD_SCDMA |
static Int |
Current network is UMTS |
static Int |
Network type is unknown |
static Int |
Phone radio is CDMA. |
static Int |
Phone radio is GSM. |
static Int |
No phone radio. |
static Int |
Phone is via SIP. |
static Int |
A premium capability that boosts the network to allow for real-time interactive traffic by prioritizing low latency communication. |
static Int |
Purchase premium capability failed because a request was already made and is in progress. |
static Int |
Purchase premium capability failed because it is already purchased and available. |
static Int |
Purchase premium capability failed because the carrier disabled or does not support the capability, as specified in |
static Int |
Purchase premium capability failed because the carrier app did not indicate success. |
static Int |
Purchase premium capability failed because the entitlement check failed. |
static Int |
Purchase premium capability failed because the device does not support the feature. |
static Int |
Purchase premium capability failed because the network is not available. |
static Int |
Purchase premium capability failed because the request was not made on the default data subscription, indicated by |
static Int |
Purchase premium capability failed because the requesting application is not in the foreground. |
static Int |
Purchase premium capability was successful and is waiting for the network to setup the slicing configuration. |
static Int |
Purchase premium capability failed because the telephony service is unavailable or there was an error in the phone process. |
static Int |
Purchase premium capability request was successful. |
static Int |
Purchase premium capability failed because the request is throttled. |
static Int |
Purchase premium capability failed because we did not receive a response from the user for the performance boost notification within the time specified by |
static Int |
Purchase premium capability failed because the user canceled the operation. |
static Int |
Purchase premium capability failed because the user disabled the feature. |
static Int |
The subscription is not valid. |
static Int |
The subscription is not valid. |
static Int |
Subscription service happened remote exception. |
static Int |
No error. |
static Int |
Validation failed when trying to switch to preferred subscription. |
static Int |
SIM card state: no SIM card is available in the device |
static Int |
SIM card state: SIM Card Error, present but faulty |
static Int |
SIM card state: SIM Card restricted, present but not usable due to carrier restrictions. |
static Int |
SIM card state: Locked: requires a network PIN to unlock |
static Int |
SIM card state: SIM Card is NOT READY |
static Int |
SIM card state: SIM Card Error, permanently disabled |
static Int |
SIM card state: Locked: requires the user's SIM PIN to unlock |
static Int |
SIM card state: Locked: requires the user's SIM PUK to unlock |
static Int |
SIM card state: Ready |
static Int |
SIM card state: Unknown. |
static Int |
A UICC card identifier used before the UICC card is loaded. |
static Int |
An unknown carrier id. |
static Int |
A UICC card identifier used if the device does not support the operation. |
static Int |
The request is aborted. |
static Int |
Disable modem fail. |
static Int |
Enable modem fail. |
static Int |
The parameter passed in is invalid. |
static Int |
Carrier app does not support multiple available networks. |
static Int |
No carrier privilege. |
static Int |
The subscription is not valid. |
static Int |
There is no OpportunisticNetworkService. |
static Int |
OpportunisticNetworkService is disabled. |
static Int |
No error. |
static Int |
There is a unknown failure happened. |
static Int |
Failure code returned when a USSD request has failed to execute because the Telephony service is unavailable. |
static Int |
Failed code returned when the mobile network has failed to complete a USSD request. |
static String |
A flavor of OMTP protocol with a different mobile originated (MO) format |
static String |
The OMTP protocol. |
Public methods | |
---|---|
open Boolean |
Whether the device supports configuring the DTMF tone length. |
open Unit |
Clear a |
open TelephonyManager? |
createForPhoneAccountHandle(phoneAccountHandle: PhoneAccountHandle!) Create a new TelephonyManager object pinned to the subscription ID associated with the given phone account. |
open TelephonyManager! |
createForSubscriptionId(subId: Int) Create a new TelephonyManager object pinned to the given subscription ID. |
open Boolean |
Get whether making changes to modem configurations by |
open Int |
Returns the number of logical modems currently configured to be activated. |
open MutableList<CellInfo!>! |
Requests all available cell information from all radios on the device including the camped/registered, serving, and neighboring cells. |
open Long |
getAllowedNetworkTypesForReason(reason: Int) Get the allowed network types for certain reason. |
open Int |
Get the user-set status for enriched calling with call composer. |
open Int |
Returns the state of all calls on the device. |
open Int |
Retrieve the call state for a specific subscription that was specified when this TelephonyManager instance was created. |
open Int |
Get the card ID of the default eUICC card. |
open PersistableBundle! |
Returns the carrier config of the subscription ID pinned to the TelephonyManager. |
open Int |
Returns carrier id based on sim MCCMNC (returned by |
open Unit |
getCarrierRestrictionStatus(executor: Executor, resultListener: Consumer<Int!>) Get the carrier restriction status of the device. |
open CellLocation! |
Returns the current location of the device. |
open Int |
Returns a constant indicating the type of activity on a data connection (cellular). |
open Int |
Returns a constant indicating the radio technology (network type) currently in use on the device for data transmission. |
open Int |
Returns a constant indicating the current data connection state (cellular). |
open String! |
Returns the unique device ID, for example, the IMEI for GSM and the MEID or ESN for CDMA phones. |
open String! |
getDeviceId(slotIndex: Int) Returns the unique device ID of a subscription, for example, the IMEI for GSM and the MEID for CDMA phones. |
open String? |
Returns the software version number for the device, for example, the IMEI/SV for GSM phones. |
open MutableMap<Int!, MutableList<EmergencyNumber!>!> |
Get the emergency number list based on current locale, sim, default, modem and network. |
open MutableMap<Int!, MutableList<EmergencyNumber!>!> |
getEmergencyNumberList(categories: Int) Get the per-category emergency number list based on current locale, sim, default, modem and network. |
open MutableList<String!> |
Returns a list of the equivalent home PLMNs (EF_EHPLMN) from the USIM app. |
open Array<String!>! |
Returns an array of Forbidden PLMNs from the USIM App Returns null if the query fails. |
open String! |
Returns the Group Identifier Level1 for a GSM phone. |
open String! |
getIccAuthentication(appType: Int, authType: Int, data: String!) Returns the response of authentication for the default subscription. |
open String! |
getImei() Returns the IMEI (International Mobile Equipment Identity). |
open String! |
Returns the IMEI (International Mobile Equipment Identity). |
open String! |
Returns the phone number string for line 1, for example, the MSISDN for a GSM phone for a particular subscription. |
open String |
Get the PLMN chosen for Manual Network Selection if active. |
open String? |
Returns the Manufacturer Code from the MEID. |
open String? |
getManufacturerCode(slotIndex: Int) Returns the Manufacturer Code from the MEID. |
open static Long |
Indicates the maximum size of the call composure picture. |
open String! |
getMeid() Returns the MEID (Mobile Equipment Identifier). |
open String! |
Returns the MEID (Mobile Equipment Identifier). |
open String! |
Returns the MMS user agent profile URL. |
open String! |
Returns the MMS user agent. |
open String! |
getNai() Returns the Network Access Identifier (NAI). |
open String! |
Returns the ISO-3166-1 alpha-2 country code equivalent of the MCC (Mobile Country Code) of the current registered operator or the cell nearby, if available. |
open String |
getNetworkCountryIso(slotIndex: Int) Returns the ISO-3166-1 alpha-2 country code equivalent of the MCC (Mobile Country Code) of the current registered operator or the cell nearby, if available. |
open String! |
Returns the numeric name (MCC+MNC) of current registered operator. |
open String! |
Returns the alphabetic name of current registered operator. |
open Int |
Get the network selection mode. |
open Unit |
getNetworkSlicingConfiguration(executor: Executor, callback: OutcomeReceiver<NetworkSlicingConfig!, TelephonyManager.NetworkSlicingException!>) Request to get the current slicing configuration including URSP rules and NSSAIs (configured, allowed and rejected). |
open String! |
Returns the network specifier of the subscription ID pinned to the TelephonyManager. |
open Int |
Return the current data network type. |
open PhoneAccountHandle? |
Determines the |
open Int |
Returns the number of phones available. |
open Int |
Returns a constant indicating the device phone type. |
open Int |
Get preferred opportunistic data subscription Id |
open String |
Returns the primary IMEI (International Mobile Equipment Identity) of the device as mentioned in GSMA TS. |
open ServiceState? |
Returns the current |
open ServiceState? |
getServiceState(includeLocationData: Int) Returns the current |
open SignalStrength? |
Get the most recently available signal strength information. |
open Int |
Returns carrier id of the current subscription. |
open CharSequence? |
Returns carrier id name of the current subscription. |
open String! |
Returns the ISO-3166-1 alpha-2 country code equivalent for the SIM provider's country code. |
open String! |
Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. |
open String! |
Returns the Service Provider Name (SPN). |
open String! |
Returns the serial number of the SIM, if applicable. |
open Int |
Returns fine-grained carrier ID of the current subscription. |
open CharSequence? |
Similar like |
open Int |
Returns a constant indicating the state of the default SIM card. |
open Int |
getSimState(slotIndex: Int) Returns a constant indicating the state of the device SIM card in a logical slot. |
open String! |
Returns the unique subscriber ID, for example, the IMSI for a GSM phone. |
open Int |
Return an appropriate subscription ID for any situation. |
open Int |
getSubscriptionId(phoneAccountHandle: PhoneAccountHandle) Returns the subscription ID for the given phone account handle. |
open Int |
Return how many logical modem can be potentially active simultaneously, in terms of hardware capability. |
open Long |
|
open String? |
Returns the Type Allocation Code from the IMEI. |
open String? |
getTypeAllocationCode(slotIndex: Int) Returns the Type Allocation Code from the IMEI. |
open MutableList<UiccCardInfo!> |
Gets information about currently inserted UICCs and eUICCs. |
open String? |
Returns the package responsible of processing visual voicemail for the subscription ID pinned to the TelephonyManager. |
open String! |
Retrieves the alphabetic identifier associated with the voice mail number. |
open String! |
Returns the voice mail number. |
open Int |
Returns the NETWORK_TYPE_xxxx for voice |
open Uri? |
getVoicemailRingtoneUri(accountHandle: PhoneAccountHandle!) Returns the URI for the per-account voicemail ringtone set in Phone settings. |
open Boolean |
Has the calling application been granted carrier privileges by the carrier. |
open Boolean |
This API is used to check if there is an ICC card present in the device. |
open Boolean |
iccCloseLogicalChannel(channel: Int) Closes a previously opened logical channel to the ICC card. |
open ByteArray! |
Returns the response APDU for a command APDU sent through SIM_IO. |
open IccOpenLogicalChannelResponse! |
iccOpenLogicalChannel(AID: String!) Opens a logical channel to the ICC card. |
open IccOpenLogicalChannelResponse! |
iccOpenLogicalChannel(AID: String!, p2: Int) Opens a logical channel to the ICC card. |
open String! |
Transmit an APDU to the ICC card over the basic channel. |
open String! |
iccTransmitApduLogicalChannel(channel: Int, cla: Int, instruction: Int, p1: Int, p2: Int, p3: Int, data: String!) Transmit an APDU to the ICC card over a logical channel. |
open Boolean |
Whether the device is currently on a technology (e.g. UMTS or LTE) which can support voice and data simultaneously. |
open Boolean | |
open Boolean |
Checks whether cellular data connection is allowed in the device. |
open Boolean |
Returns whether mobile data is enabled or not per user setting. |
open Boolean |
isDataEnabledForReason(reason: Int) Return whether data is enabled for certain reason . |
open Boolean |
Returns whether mobile data roaming is enabled on the subscription. |
open Boolean | |
open Boolean | |
open Boolean |
isEmergencyNumber(number: String) Identifies if the supplied phone number is an emergency number that matches a known emergency number based on current locale, SIM card(s), Android database, modem, network, or defaults. |
open Boolean |
Whether the phone supports hearing aid compatibility. |
open Boolean |
Checks if manual network selection is allowed. |
open Boolean |
isModemEnabledForSlot(slotIndex: Int) Indicates whether or not there is a modem stack enabled for the given SIM slot. |
open Int |
Returns if the usage of multiple SIM cards at the same time to register on the network (e.g. Dual Standby or Dual Active) is supported by the device and by the carrier. |
open Boolean |
Returns true if the device is considered roaming on the current network, for GSM purposes. |
open Boolean |
isPremiumCapabilityAvailableForPurchase(capability: Int) Check whether the given premium capability is available for purchase from the carrier. |
open Boolean |
isRadioInterfaceCapabilitySupported(capability: String) Whether the device supports a given capability on the radio interface. |
open Boolean |
Determines whether the device currently supports RTT (Real-time text). |
open Boolean | |
open Boolean | |
open Boolean | |
open Boolean |
isVoicemailVibrationEnabled(accountHandle: PhoneAccountHandle!) Returns whether vibration is set for voicemail notification in Phone settings. |
open Boolean |
Whether the device is a world phone. |
open Unit |
listen(listener: PhoneStateListener!, events: Int) Registers a listener object to receive notification of changes in specified telephony states. |
open Unit |
purchasePremiumCapability(capability: Int, executor: Executor, callback: Consumer<Int!>) Purchase the given premium capability from the carrier. |
open Unit |
Generate a radio modem reset. |
open Unit |
registerTelephonyCallback(includeLocationData: Int, executor: Executor, callback: TelephonyCallback) Registers a callback object to receive notification of changes in specified telephony states. |
open Unit |
registerTelephonyCallback(executor: Executor, callback: TelephonyCallback) Registers a callback object to receive notification of changes in specified telephony states. |
open Unit |
requestCellInfoUpdate(executor: Executor, callback: TelephonyManager.CellInfoCallback) Requests all available cell information from the current subscription for observed camped/registered, serving, and neighboring cells. |
open NetworkScan! |
requestNetworkScan(request: NetworkScanRequest!, executor: Executor!, callback: TelephonyScanManager.NetworkScanCallback!) Request a network scan. |
open NetworkScan? |
requestNetworkScan(includeLocationData: Int, request: NetworkScanRequest, executor: Executor, callback: TelephonyScanManager.NetworkScanCallback) Request a network scan. |
open Unit |
sendDialerSpecialCode(inputCode: String!) Send the special dialer code. |
open String! |
sendEnvelopeWithStatus(content: String!) Send ENVELOPE to the SIM and return the response. |
open Unit |
sendUssdRequest(ussdRequest: String!, callback: TelephonyManager.UssdResponseCallback!, handler: Handler!) Sends an Unstructured Supplementary Service Data (USSD) request to the mobile network and informs the caller of the response via the supplied |
open Unit |
sendVisualVoicemailSms(number: String!, port: Int, text: String!, sentIntent: PendingIntent!) Send a visual voicemail SMS. |
open Unit |
setAllowedNetworkTypesForReason(reason: Int, allowedNetworkTypes: Long) Set the allowed network types of the device and provide the reason triggering the allowed network change. |
open Unit |
setCallComposerStatus(status: Int) Set the user-set status for enriched calling with call composer. |
open Unit |
setDataEnabled(enable: Boolean) Turns mobile data on or off. |
open Unit |
setDataEnabledForReason(reason: Int, enabled: Boolean) Control of data connection and provide the reason triggering the data connection control. |
open Int |
setForbiddenPlmns(fplmns: MutableList<String!>) Replace the contents of the forbidden PLMN SIM file with the provided values. |
open Boolean |
setLine1NumberForDisplay(alphaTag: String!, number: String!) Set the line 1 phone number string and its alphatag for the current ICCID for display purpose only, for example, displayed in Phone Status. |
open Unit |
Sets the network selection mode to automatic. |
open Boolean |
setNetworkSelectionModeManual(operatorNumeric: String!, persistSelection: Boolean) Ask the radio to connect to the input network and change selection mode to manual. |
open Boolean |
setNetworkSelectionModeManual(operatorNumeric: String, persistSelection: Boolean, ran: Int) Ask the radio to connect to the input network and change selection mode to manual. |
open Boolean |
setOperatorBrandOverride(brand: String!) Override the branding for the current ICCID. |
open Boolean |
Set the preferred network type to global mode which includes NR, LTE, CDMA, EvDo and GSM/WCDMA. |
open Unit |
setPreferredOpportunisticDataSubscription(subId: Int, needValidation: Boolean, executor: Executor?, callback: Consumer<Int!>?) Set preferred opportunistic data subscription id. |
open Unit |
Set a |
open Unit |
Set the visual voicemail SMS filter settings for the subscription ID pinned to the TelephonyManager. |
open Boolean |
setVoiceMailNumber(alphaTag: String!, number: String!) Sets the voice mail number. |
open Unit |
setVoicemailRingtoneUri(phoneAccountHandle: PhoneAccountHandle!, uri: Uri!) Sets the per-account voicemail ringtone. |
open Unit |
setVoicemailVibrationEnabled(phoneAccountHandle: PhoneAccountHandle!, enabled: Boolean) Sets the per-account preference whether vibration is enabled for voicemail notifications. |
open Unit |
switchMultiSimConfig(numOfSims: Int) Switch configs to enable multi-sim or switch back to single-sim |
open Unit |
unregisterTelephonyCallback(callback: TelephonyCallback) Unregister an existing |
open Unit |
updateAvailableNetworks(availableNetworks: MutableList<AvailableNetworkInfo!>, executor: Executor?, callback: Consumer<Int!>?) Update availability of a list of networks in the current location. |
open Unit |
uploadCallComposerPicture(pictureToUpload: InputStream, contentType: String, executor: Executor, callback: OutcomeReceiver<ParcelUuid!, TelephonyManager.CallComposerException!>) Uploads a picture to the carrier network for use with call composer. |
open Unit |
uploadCallComposerPicture(pictureToUpload: Path, contentType: String, executor: Executor, callback: OutcomeReceiver<ParcelUuid!, TelephonyManager.CallComposerException!>) Uploads a picture to the carrier network for use with call composer. |
Properties | |
---|---|
static String! |
Value used with |
static String! |
Value used with |
static String! |
Value used with |
Constants
ACTION_CARRIER_MESSAGING_CLIENT_SERVICE
static val ACTION_CARRIER_MESSAGING_CLIENT_SERVICE: String
A service action that identifies a android.service.carrier.CarrierMessagingClientService
subclass in the AndroidManifest.xml.
See android.service.carrier.CarrierMessagingClientService
for the details.
Value: "android.telephony.action.CARRIER_MESSAGING_CLIENT_SERVICE"
ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE
static val ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE: String
Broadcast action sent when the availability of the system default network changes.
Value: "android.telephony.action.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE"
ACTION_CARRIER_SIGNAL_PCO_VALUE
static val ACTION_CARRIER_SIGNAL_PCO_VALUE: String
Broadcast action sent when a PCO value becomes available from the modem. This action is intended for sim/account status checks and only sent to the carrier apps specified in the carrier config for the subscription ID that's attached to this intent. The intent will have the following extra values:
EXTRA_APN_TYPE
- An integer indicating the apn type.
EXTRA_APN_PROTOCOL
- An integer indicating the protocol of the apn connection
EXTRA_PCO_ID
- An integer indicating the PCO id for the data.
EXTRA_PCO_VALUE
- A byte array of PCO data read from modem.
SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX
- The subscription ID for which the PCO info was received.
This is a protected intent that can only be sent by the system.
Value: "android.telephony.action.CARRIER_SIGNAL_PCO_VALUE"
ACTION_CARRIER_SIGNAL_REDIRECTED
static val ACTION_CARRIER_SIGNAL_REDIRECTED: String
Broadcast action sent when a data connection is redirected with validation failure. This action is intended for sim/account status checks and only sent to the carrier apps specified in the carrier config for the subscription ID that's attached to this intent. The intent will have the following extra values:
EXTRA_APN_TYPE
- An integer indicating the apn type.
EXTRA_REDIRECTION_URL
- A string indicating the redirection url
SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX
- The subscription ID on which the validation failure happened.
This is a protected intent that can only be sent by the system.
Value: "android.telephony.action.CARRIER_SIGNAL_REDIRECTED"
ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED
static val ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED: String
Broadcast action sent when a data connection setup fails. This action is intended for sim/account status checks and only sent to the carrier apps specified in the carrier config for the subscription ID that's attached to this intent. The intent will have the following extra values:
EXTRA_APN_TYPE
- An integer indicating the apn type.
EXTRA_DATA_FAIL_CAUSE
- A integer indicating the data fail cause.
SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX
- The subscription ID on which the data setup failure happened.
This is a protected intent that can only be sent by the system.
Value: "android.telephony.action.CARRIER_SIGNAL_REQUEST_NETWORK_FAILED"
ACTION_CARRIER_SIGNAL_RESET
static val ACTION_CARRIER_SIGNAL_RESET: String
Broadcast action sent when carrier apps should reset their internal state. Sent when certain events such as turning on/off mobile data, removing the SIM, etc. require carrier apps to reset their state. This action is intended to signal carrier apps to perform cleanup operations. It is only sent to the carrier apps specified in the carrier config for the subscription ID attached to this intent. The intent will have the following extra values:
SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX
- The subscription ID for which state should be reset.
This is a protected intent that can only be sent by the system.
Value: "android.telephony.action.CARRIER_SIGNAL_RESET"
ACTION_CONFIGURE_VOICEMAIL
static val ACTION_CONFIGURE_VOICEMAIL: String
Open the voicemail settings activity to make changes to voicemail configuration.
The EXTRA_PHONE_ACCOUNT_HANDLE
extra indicates which PhoneAccountHandle
to configure voicemail. The EXTRA_HIDE_PUBLIC_SETTINGS
hides settings the dialer will modify through public API if set.
Value: "android.telephony.action.CONFIGURE_VOICEMAIL"
ACTION_MULTI_SIM_CONFIG_CHANGED
static val ACTION_MULTI_SIM_CONFIG_CHANGED: String
Broadcast action to be received by Broadcast receivers. Indicates multi-SIM configuration is changed. For example, it changed from single SIM capable to dual-SIM capable (DSDS or DSDA) or triple-SIM mode. It doesn't indicate how many subscriptions are actually active, or which states SIMs are, or that all steps during multi-SIM change are done. To know those information you still need to listen to SIM_STATE changes or active subscription changes. See extra of EXTRA_ACTIVE_SIM_SUPPORTED_COUNT
for updated value.
Value: "android.telephony.action.MULTI_SIM_CONFIG_CHANGED"
ACTION_NETWORK_COUNTRY_CHANGED
static val ACTION_NETWORK_COUNTRY_CHANGED: String
Broadcast intent action for network country code changes.
The EXTRA_NETWORK_COUNTRY
extra indicates the country code of the current network returned by getNetworkCountryIso()
.
There may be a delay of several minutes before reporting that no country is detected.
Value: "android.telephony.action.NETWORK_COUNTRY_CHANGED"
ACTION_PHONE_STATE_CHANGED
static val ACTION_PHONE_STATE_CHANGED: String
Broadcast intent action indicating that the call state on the device has changed.
The EXTRA_STATE
extra indicates the new call state. If a receiving app has android.Manifest.permission#READ_CALL_LOG
permission, a second extra EXTRA_INCOMING_NUMBER
provides the phone number for incoming and outgoing calls as a String.
If the receiving app has android.Manifest.permission#READ_CALL_LOG
and android.Manifest.permission#READ_PHONE_STATE
permission, it will receive the broadcast twice; one with the EXTRA_INCOMING_NUMBER
populated with the phone number, and another with it blank. Due to the nature of broadcasts, you cannot assume the order in which these broadcasts will arrive, however you are guaranteed to receive two in this case. Apps which are interested in the EXTRA_INCOMING_NUMBER
can ignore the broadcasts where EXTRA_INCOMING_NUMBER
is not present in the extras (e.g. where Intent.hasExtra(String)
returns false
).
This was a android.content.Context#sendStickyBroadcast broadcast in version 1.0, but it is no longer sticky. Instead, use getCallState
to synchronously query the current call state.
Requires android.Manifest.permission#READ_PHONE_STATE
Value: "android.intent.action.PHONE_STATE"
ACTION_RESET_MOBILE_NETWORK_SETTINGS
static val ACTION_RESET_MOBILE_NETWORK_SETTINGS: String
Activity action: Show setting to reset mobile networks.
On devices with a settings activity to reset mobile networks, the activity should be launched without additional permissions.
On some devices, this settings activity may not exist. Callers should ensure that this case is appropriately handled.
Value: "android.telephony.action.RESET_MOBILE_NETWORK_SETTINGS"
ACTION_RESPOND_VIA_MESSAGE
static val ACTION_RESPOND_VIA_MESSAGE: String
The Phone app sends this intent when a user opts to respond-via-message during an incoming call. By default, the device's default SMS app consumes this message and sends a text message to the caller. A third party app can also provide this functionality by consuming this Intent with a android.app.Service
and sending the message using its own messaging system.
The intent contains a URI (available from android.content.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 android.content.Intent#EXTRA_TEXT
) and a message subject (in android.content.Intent#EXTRA_SUBJECT
).
Note: The intent-filter that consumes this Intent needs to be in a android.app.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.
Value: "android.intent.action.RESPOND_VIA_MESSAGE"
ACTION_SECRET_CODE
static val ACTION_SECRET_CODE: String
Broadcast Action: A debug code has been entered in the dialer.
This intent is broadcast by the system and OEM telephony apps may need to receive these broadcasts. And it requires the sender to be default dialer or has carrier privileges (see hasCarrierPrivileges
).
These "secret codes" are used to activate developer menus by dialing certain codes. And they are of the form *#*#<code>#*#*
. The intent will have the data URI: android_secret_code://<code>
. It is possible that a manifest receiver would be woken up even if it is not currently running.
It is supposed to replace android.provider.Telephony.Sms.Intents#SECRET_CODE_ACTION
in the next Android version. Before that both of these two actions will be broadcast.
Value: "android.telephony.action.SECRET_CODE"
ACTION_SHOW_VOICEMAIL_NOTIFICATION
static val ACTION_SHOW_VOICEMAIL_NOTIFICATION: String
Broadcast intent action for letting the default dialer to know to show voicemail notification.
The EXTRA_PHONE_ACCOUNT_HANDLE
extra indicates which PhoneAccountHandle
the voicemail is received on. The EXTRA_NOTIFICATION_COUNT
extra indicates the total numbers of unheard voicemails. The EXTRA_VOICEMAIL_NUMBER
extra indicates the voicemail number if available. The EXTRA_CALL_VOICEMAIL_INTENT
extra is a android.app.PendingIntent
that will call the voicemail number when sent. This extra will be empty if the voicemail number is not set, and EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT
will be set instead. The EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT
extra is a android.app.PendingIntent
that will launch the voicemail settings. This extra is only available when the voicemail number is not set. The EXTRA_IS_REFRESH
extra indicates whether the notification is a refresh or a new notification.
Value: "android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION"
ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED
static val ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED: String
Broadcast Action: The subscription carrier identity has changed. This intent could be sent on the following events:
- Subscription absent. Carrier identity could change from a valid id to
TelephonyManager.UNKNOWN_CARRIER_ID
. - Subscription loaded. Carrier identity could change from
TelephonyManager.UNKNOWN_CARRIER_ID
to a valid id. - The subscription carrier is recognized after a remote update.
EXTRA_CARRIER_ID
The up-to-date carrier id of the current subscription id.EXTRA_CARRIER_NAME
The up-to-date carrier name of the current subscription.EXTRA_SUBSCRIPTION_ID
The subscription id associated with the changed carrier identity.
This is a protected intent that can only be sent by the system.
Value: "android.telephony.action.SUBSCRIPTION_CARRIER_IDENTITY_CHANGED"
ACTION_SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED
static val ACTION_SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED: String
Broadcast Action: The subscription specific carrier identity has changed. A specific carrier ID returns the fine-grained carrier ID of the current subscription. It can represent the fact that a carrier may be in effect an aggregation of other carriers (ie in an MVNO type scenario) where each of these specific carriers which are used to make up the actual carrier service may have different carrier configurations. A specific carrier ID could also be used, for example, in a scenario where a carrier requires different carrier configuration for different service offering such as a prepaid plan. the specific carrier ID would be used for configuration purposes, but apps wishing to know about the carrier itself should use the regular carrier ID returned by getSimCarrierId()
.
Similar like ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED
, this intent will be sent on the event of ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED
while its also possible to be sent without ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED
when specific carrier ID changes while carrier ID remains the same. e.g, the same subscription switches to different IMSI could potentially change its specific carrier ID while carrier id remains the same.
Value: "android.telephony.action.SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED"
ALLOWED_NETWORK_TYPES_REASON_CARRIER
static val ALLOWED_NETWORK_TYPES_REASON_CARRIER: Int
To indicate allowed network type change is requested by carrier. Carrier configuration won't affect the settings configured through other reasons and will result in allowing network types that are in both configurations (i.e intersection of both sets).
Value: 2
ALLOWED_NETWORK_TYPES_REASON_USER
static val ALLOWED_NETWORK_TYPES_REASON_USER: Int
To indicate allowed network type change is requested by user.
Value: 0
APPTYPE_CSIM
static val APPTYPE_CSIM: Int
UICC application type is CSIM
Value: 4
APPTYPE_ISIM
static val APPTYPE_ISIM: Int
UICC application type is ISIM
Value: 5
APPTYPE_RUIM
static val APPTYPE_RUIM: Int
UICC application type is RUIM
Value: 3
APPTYPE_UNKNOWN
static val APPTYPE_UNKNOWN: Int
UICC application type is unknown or not specified
Value: 0
APPTYPE_USIM
static val APPTYPE_USIM: Int
UICC application type is USIM
Value: 2
AUTHTYPE_EAP_AKA
static val AUTHTYPE_EAP_AKA: Int
Authentication type for UICC challenge is EAP AKA. See RFC 4187 for details.
Value: 129
AUTHTYPE_EAP_SIM
static val AUTHTYPE_EAP_SIM: Int
Authentication type for UICC challenge is EAP SIM. See RFC 4186 for details.
Value: 128
AUTHTYPE_GBA_BOOTSTRAP
static val AUTHTYPE_GBA_BOOTSTRAP: Int
Authentication type for GBA Bootstrap Challenge. Pass this authentication type into the getIccAuthentication
API to perform a GBA Bootstrap challenge (BSF), with data
(generated according to the procedure defined in 3GPP 33.220 Section 5.3.2 step.4) in base64 encoding. This method will return the Bootstrapping response in base64 encoding when ICC authentication is completed. Ref 3GPP 33.220 Section 5.3.2.
Value: 132
AUTHTYPE_GBA_NAF_KEY_EXTERNAL
static val AUTHTYPE_GBA_NAF_KEY_EXTERNAL: Int
Authentication type for GBA Network Application Functions (NAF) key External Challenge. Pass this authentication type into the getIccAuthentication
API to perform a GBA Network Applications Functions (NAF) key External challenge using the NAF_ID parameter as the data
in base64 encoding. This method will return the Ks_Ext_Naf key in base64 encoding when ICC authentication is completed. Ref 3GPP 33.220 Section 5.3.2.
Value: 133
CALL_COMPOSER_STATUS_BUSINESS_ONLY
static val CALL_COMPOSER_STATUS_BUSINESS_ONLY: Int
Call composer status Business Only from user setting.
Value: 2
CALL_COMPOSER_STATUS_OFF
static val CALL_COMPOSER_STATUS_OFF: Int
Call composer status OFF from user setting.
Value: 0
CALL_COMPOSER_STATUS_ON
static val CALL_COMPOSER_STATUS_ON: Int
Call composer status ON from user setting.
Value: 1
CALL_STATE_IDLE
static val CALL_STATE_IDLE: Int
Device call state: No activity.
Value: 0
CALL_STATE_OFFHOOK
static val CALL_STATE_OFFHOOK: Int
Device call state: Off-hook. At least one call exists that is dialing, active, or on hold, and no calls are ringing or waiting.
Value: 2
CALL_STATE_RINGING
static val CALL_STATE_RINGING: Int
Device call state: Ringing. A new call arrived and is ringing or waiting. In the latter case, another call is already active.
Value: 1
CAPABILITY_SLICING_CONFIG_SUPPORTED
static val CAPABILITY_SLICING_CONFIG_SUPPORTED: String
Indicates whether getNetworkSlicingConfiguration
is supported. See comments on respective methods for more information.
Value: "CAPABILITY_SLICING_CONFIG_SUPPORTED"
CARRIER_RESTRICTION_STATUS_NOT_RESTRICTED
static val CARRIER_RESTRICTION_STATUS_NOT_RESTRICTED: Int
The device is not restricted to a carrier
Value: 1
CARRIER_RESTRICTION_STATUS_RESTRICTED
static val CARRIER_RESTRICTION_STATUS_RESTRICTED: Int
The device is restricted to a carrier.
Value: 2
CARRIER_RESTRICTION_STATUS_RESTRICTED_TO_CALLER
static val CARRIER_RESTRICTION_STATUS_RESTRICTED_TO_CALLER: Int
The device is restricted to the carrier of the calling application.
Value: 3
CARRIER_RESTRICTION_STATUS_UNKNOWN
static val CARRIER_RESTRICTION_STATUS_UNKNOWN: Int
Carrier restriction status value is unknown, in case modem did not provide any information about carrier restriction status.
Value: 0
CDMA_ROAMING_MODE_AFFILIATED
static val CDMA_ROAMING_MODE_AFFILIATED: Int
Value for CarrierConfigManager.KEY_CDMA_ROAMING_MODE_INT
which permits roaming on affiliated networks.
Value: 1
CDMA_ROAMING_MODE_ANY
static val CDMA_ROAMING_MODE_ANY: Int
Value for CarrierConfigManager.KEY_CDMA_ROAMING_MODE_INT
which permits roaming on any network.
Value: 2
CDMA_ROAMING_MODE_HOME
static val CDMA_ROAMING_MODE_HOME: Int
Value for CarrierConfigManager.KEY_CDMA_ROAMING_MODE_INT
which only permits connections on home networks.
Value: 0
CDMA_ROAMING_MODE_RADIO_DEFAULT
static val CDMA_ROAMING_MODE_RADIO_DEFAULT: Int
Value for CarrierConfigManager.KEY_CDMA_ROAMING_MODE_INT
which leaves the roaming mode set to the radio default or to the user's preference if they've indicated one.
Value: -1
DATA_ACTIVITY_DORMANT
static val DATA_ACTIVITY_DORMANT: Int
Data connection is active, but physical link is down
Value: 4
DATA_ACTIVITY_IN
static val DATA_ACTIVITY_IN: Int
Data connection activity: Currently receiving IP PPP traffic.
Value: 1
DATA_ACTIVITY_INOUT
static val DATA_ACTIVITY_INOUT: Int
Data connection activity: Currently both sending and receiving IP PPP traffic.
Value: 3
DATA_ACTIVITY_NONE
static val DATA_ACTIVITY_NONE: Int
Data connection activity: No traffic.
Value: 0
DATA_ACTIVITY_OUT
static val DATA_ACTIVITY_OUT: Int
Data connection activity: Currently sending IP PPP traffic.
Value: 2
DATA_CONNECTED
static val DATA_CONNECTED: Int
Data connection state: Connected. IP traffic should be available.
Value: 2
DATA_CONNECTING
static val DATA_CONNECTING: Int
Data connection state: Currently setting up a data connection.
Value: 1
DATA_DISCONNECTED
static val DATA_DISCONNECTED: Int
Data connection state: Disconnected. IP traffic not available.
Value: 0
DATA_DISCONNECTING
static val DATA_DISCONNECTING: Int
Data connection state: Disconnecting. IP traffic may be available but will cease working imminently.
Value: 4
DATA_ENABLED_REASON_CARRIER
static val DATA_ENABLED_REASON_CARRIER: Int
To indicate enable or disable carrier data by the system based on carrier signalling or carrier privileged apps. Carrier data on/off won't affect user settings but will bypass the settings and turns off data internally if set to false
.
Value: 2
DATA_ENABLED_REASON_OVERRIDE
static val DATA_ENABLED_REASON_OVERRIDE: Int
To indicate data was enabled or disabled due to mobile data policy overrides. Note that this is not a valid reason for setDataEnabledForReason(int,boolean)
and is only used to indicate that data enabled was changed due to an override.
Value: 4
DATA_ENABLED_REASON_POLICY
static val DATA_ENABLED_REASON_POLICY: Int
To indicate that data control due to policy. Usually used when data limit is passed. Policy data on/off won't affect user settings but will bypass the settings and turns off data internally if set to false
.
Value: 1
DATA_ENABLED_REASON_THERMAL
static val DATA_ENABLED_REASON_THERMAL: Int
To indicate enable or disable data by thermal service. Thermal data on/off won't affect user settings but will bypass the settings and turns off data internally if set to false
.
Value: 3
DATA_ENABLED_REASON_UNKNOWN
static val DATA_ENABLED_REASON_UNKNOWN: Int
To indicate that data was enabled or disabled due to an unknown reason. Note that this is not a valid reason for setDataEnabledForReason(int,boolean)
and is only used to indicate that data enabled was changed.
Value: -1
DATA_ENABLED_REASON_USER
static val DATA_ENABLED_REASON_USER: Int
To indicate that user enabled or disabled data.
Value: 0
DATA_HANDOVER_IN_PROGRESS
static val DATA_HANDOVER_IN_PROGRESS: Int
Data connection state: Handover in progress. The connection is being transited from cellular network to IWLAN, or from IWLAN to cellular network.
Value: 5
DATA_SUSPENDED
static val DATA_SUSPENDED: Int
Data connection state: Suspended. The connection is up, but IP traffic is temporarily unavailable. For example, in a 2G network, data activity may be suspended when a voice call arrives.
Value: 3
DATA_UNKNOWN
static val DATA_UNKNOWN: Int
Data connection state: Unknown. Used before we know the state.
Value: -1
DEFAULT_PORT_INDEX
static val DEFAULT_PORT_INDEX: Int
Default port index for a UICC. On physical SIM cards the only available port is 0. See android.telephony.UiccPortInfo
for more information on ports. See android.telephony.euicc.EuiccManager#isSimPortAvailable(int)
for information on how portIndex is used on eUICCs.
Value: 0
ERI_FLASH
static val ERI_FLASH: Int
ERI (Enhanced Roaming Indicator) is FLASH i.e value 2 defined by 3GPP2 C.R1001-H v1.0 Table 8.1-1.
Value: 2
ERI_OFF
static val ERI_OFF: Int
ERI (Enhanced Roaming Indicator) is OFF i.e value 1 defined by 3GPP2 C.R1001-H v1.0 Table 8.1-1.
Value: 1
ERI_ON
static val ERI_ON: Int
ERI (Enhanced Roaming Indicator) is ON i.e value 0 defined by 3GPP2 C.R1001-H v1.0 Table 8.1-1.
Value: 0
EVENT_DISPLAY_EMERGENCY_MESSAGE
static val EVENT_DISPLAY_EMERGENCY_MESSAGE: String
Event reported from the Telephony stack to indicate that the Connection
is not able to find any network and likely will not get connected. Upon receiving this event, the dialer app should start the app included in the extras bundle of this event if satellite is provisioned.
The dialer app receives this event via Call.Callback.onConnectionEvent(Call, String, Bundle)
.
The Bundle
parameter is guaranteed to include the following extras if the below conditions are met:
EXTRA_EMERGENCY_CALL_TO_SATELLITE_HANDOVER_TYPE
- the recommending handover type.EXTRA_EMERGENCY_CALL_TO_SATELLITE_LAUNCH_INTENT
- thePendingIntent
which will be launched by the Dialer app when receiving this connection event.
If the device is connected to satellite via carrier within the hysteresis time defined by the carrier config CarrierConfigManager.KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT
, the component of the EXTRA_EMERGENCY_CALL_TO_SATELLITE_LAUNCH_INTENT
will be set to the default SMS app.
Otherwise, if the overlay config config_oem_enabled_satellite_handover_app
is present, the app defined by this config will be used as the component of the EXTRA_EMERGENCY_CALL_TO_SATELLITE_LAUNCH_INTENT
. If this overlay config is empty, EXTRA_EMERGENCY_CALL_TO_SATELLITE_LAUNCH_INTENT
will not be included in the event EVENT_DISPLAY_EMERGENCY_MESSAGE
.
Value: "android.telephony.event.DISPLAY_EMERGENCY_MESSAGE"
EXTRA_ACTIVE_SIM_SUPPORTED_COUNT
static val EXTRA_ACTIVE_SIM_SUPPORTED_COUNT: String
The number of active SIM supported by current multi-SIM config. It's not related to how many SIM/subscriptions are currently active. Same value will be returned by getActiveModemCount()
. For single SIM mode, it's 1. For DSDS or DSDA mode, it's 2. For triple-SIM mode, it's 3. Extra of ACTION_MULTI_SIM_CONFIG_CHANGED
. type: integer
Value: "android.telephony.extra.ACTIVE_SIM_SUPPORTED_COUNT"
EXTRA_APN_PROTOCOL
static val EXTRA_APN_PROTOCOL: String
An integer extra containing the protocol of the apn connection. Sent with the ACTION_CARRIER_SIGNAL_PCO_VALUE
broadcast. See the PROTOCOL_*
constants in ApnSetting
for a list of possible values.
Value: "android.telephony.extra.APN_PROTOCOL"
EXTRA_APN_TYPE
static val EXTRA_APN_TYPE: String
An integer extra containing the APN type. Sent with the ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED
, ACTION_CARRIER_SIGNAL_REDIRECTED
, and ACTION_CARRIER_SIGNAL_PCO_VALUE
broadcasts. See the TYPE_
constants in ApnSetting
for a list of possible values.
Value: "android.telephony.extra.APN_TYPE"
EXTRA_CALL_VOICEMAIL_INTENT
static val EXTRA_CALL_VOICEMAIL_INTENT: String
The intent to call voicemail.
Value: "android.telephony.extra.CALL_VOICEMAIL_INTENT"
EXTRA_CARRIER_ID
static val EXTRA_CARRIER_ID: String
An int extra used with ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED
which indicates the updated carrier id returned by TelephonyManager.getSimCarrierId()
.
Will be TelephonyManager.UNKNOWN_CARRIER_ID
if the subscription is unavailable or the carrier cannot be identified.
Value: "android.telephony.extra.CARRIER_ID"
EXTRA_CARRIER_NAME
static val EXTRA_CARRIER_NAME: String
An string extra used with ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED
which indicates the updated carrier name of the current subscription.
Value: "android.telephony.extra.CARRIER_NAME"
EXTRA_DATA_FAIL_CAUSE
static val EXTRA_DATA_FAIL_CAUSE: String
An integer extra containing the data fail cause. Sent with ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED
. See DataFailCause
for a list of possible values.
Value: "android.telephony.extra.DATA_FAIL_CAUSE"
EXTRA_DEFAULT_NETWORK_AVAILABLE
static val EXTRA_DEFAULT_NETWORK_AVAILABLE: String
A boolean extra indicating the availability of the default network. Sent with the ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE
broadcast.
Value: "android.telephony.extra.DEFAULT_NETWORK_AVAILABLE"
EXTRA_EMERGENCY_CALL_TO_SATELLITE_HANDOVER_TYPE
static val EXTRA_EMERGENCY_CALL_TO_SATELLITE_HANDOVER_TYPE: String
Integer extra key used with EVENT_DISPLAY_EMERGENCY_MESSAGE
which indicates the type of handover from emergency call to satellite messaging.
Will be either android.telephony.satellite.SatelliteManager#EMERGENCY_CALL_TO_SATELLITE_HANDOVER_TYPE_SOS or android.telephony.satellite.SatelliteManager#EMERGENCY_CALL_TO_SATELLITE_HANDOVER_TYPE_T911
Set in the extras for the EVENT_DISPLAY_EMERGENCY_MESSAGE
connection event.
Value: "android.telephony.extra.EMERGENCY_CALL_TO_SATELLITE_HANDOVER_TYPE"
EXTRA_EMERGENCY_CALL_TO_SATELLITE_LAUNCH_INTENT
static val EXTRA_EMERGENCY_CALL_TO_SATELLITE_LAUNCH_INTENT: String
Extra key used with the EVENT_DISPLAY_EMERGENCY_MESSAGE
for a PendingIntent
which will be launched by the Dialer app.
Value: "android.telephony.extra.EMERGENCY_CALL_TO_SATELLITE_LAUNCH_INTENT"
EXTRA_HIDE_PUBLIC_SETTINGS
static val EXTRA_HIDE_PUBLIC_SETTINGS: String
The boolean value indicating whether the voicemail settings activity launched by ACTION_CONFIGURE_VOICEMAIL
should hide settings accessible through public API. This is used by dialer implementations which provides their own voicemail settings UI, but still needs to expose device specific voicemail settings to the user.
Value: "android.telephony.extra.HIDE_PUBLIC_SETTINGS"
EXTRA_INCOMING_NUMBER
static valEXTRA_INCOMING_NUMBER: String
Deprecated: Companion apps for wearable devices should use the InCallService
API to retrieve the phone number for calls instead. Apps performing call screening should use the CallScreeningService
API instead.
Extra key used with the ACTION_PHONE_STATE_CHANGED
broadcast for a String containing the incoming or outgoing phone number.
This extra is only populated for receivers of the ACTION_PHONE_STATE_CHANGED
broadcast which have been granted the android.Manifest.permission#READ_CALL_LOG
and android.Manifest.permission#READ_PHONE_STATE
permissions.
For incoming calls, the phone number is only guaranteed to be populated when the EXTRA_STATE
changes from EXTRA_STATE_IDLE
to EXTRA_STATE_RINGING
. If the incoming caller is from an unknown number, the extra will be populated with an empty string. For outgoing calls, the phone number is only guaranteed to be populated when the EXTRA_STATE
changes from EXTRA_STATE_IDLE
to EXTRA_STATE_OFFHOOK
.
Retrieve with android.content.Intent#getStringExtra(String)
.
Value: "incoming_number"
EXTRA_IS_REFRESH
static val EXTRA_IS_REFRESH: String
Boolean value representing whether the android.telephony.TelephonyManager#ACTION_SHOW_VOICEMAIL_NOTIFICATION
is new or a refresh of an existing notification. Notification refresh happens after reboot or connectivity changes. The user has already been notified for the voicemail so it should not alert the user, and should not be shown again if the user has dismissed it.
Value: "android.telephony.extra.IS_REFRESH"
EXTRA_LAST_KNOWN_NETWORK_COUNTRY
static val EXTRA_LAST_KNOWN_NETWORK_COUNTRY: String
The extra used with an ACTION_NETWORK_COUNTRY_CHANGED
to specify the last known the country code in ISO-3166-1 alpha-2 format. This might be an empty string when the country code was never available. The last known country code persists across reboot.
Retrieve with android.content.Intent#getStringExtra(String)
.
Value: "android.telephony.extra.LAST_KNOWN_NETWORK_COUNTRY"
EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT
static val EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT: String
The intent to launch voicemail settings.
Value: "android.telephony.extra.LAUNCH_VOICEMAIL_SETTINGS_INTENT"
EXTRA_NETWORK_COUNTRY
static val EXTRA_NETWORK_COUNTRY: String
The extra used with an ACTION_NETWORK_COUNTRY_CHANGED
to specify the the country code in ISO-3166-1 alpha-2 format. This is the same country code returned by getNetworkCountryIso()
. This might be an empty string when the country code is not available.
Retrieve with android.content.Intent#getStringExtra(String)
.
Value: "android.telephony.extra.NETWORK_COUNTRY"
EXTRA_NOTIFICATION_COUNT
static val EXTRA_NOTIFICATION_COUNT: String
The number of voice messages associated with the notification.
Value: "android.telephony.extra.NOTIFICATION_COUNT"
EXTRA_PCO_ID
static val EXTRA_PCO_ID: String
An integer extra indicating the ID for the PCO data. Sent with the ACTION_CARRIER_SIGNAL_PCO_VALUE
broadcast.
Value: "android.telephony.extra.PCO_ID"
EXTRA_PCO_VALUE
static val EXTRA_PCO_VALUE: String
A byte array extra containing PCO data read from the modem. Sent with the ACTION_CARRIER_SIGNAL_PCO_VALUE
broadcast.
Value: "android.telephony.extra.PCO_VALUE"
EXTRA_PHONE_ACCOUNT_HANDLE
static val EXTRA_PHONE_ACCOUNT_HANDLE: String
The extra used with an ACTION_CONFIGURE_VOICEMAIL
and ACTION_SHOW_VOICEMAIL_NOTIFICATION
Intent
to specify the PhoneAccountHandle
the configuration or notification is for.
Retrieve with android.content.Intent#getParcelableExtra(String)
.
Value: "android.telephony.extra.PHONE_ACCOUNT_HANDLE"
EXTRA_REDIRECTION_URL
static val EXTRA_REDIRECTION_URL: String
String extra containing the redirection URL sent with ACTION_CARRIER_SIGNAL_REDIRECTED
.
Value: "android.telephony.extra.REDIRECTION_URL"
EXTRA_SPECIFIC_CARRIER_ID
static val EXTRA_SPECIFIC_CARRIER_ID: String
An int extra used with ACTION_SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED
which indicates the updated specific carrier id returned by TelephonyManager.getSimSpecificCarrierId()
. Note, its possible specific carrier id changes while ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED
remains the same e.g, when subscription switch to different IMSIs.
Will be TelephonyManager.UNKNOWN_CARRIER_ID
if the subscription is unavailable or the carrier cannot be identified.
Value: "android.telephony.extra.SPECIFIC_CARRIER_ID"
EXTRA_SPECIFIC_CARRIER_NAME
static val EXTRA_SPECIFIC_CARRIER_NAME: String
An string extra used with ACTION_SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED
which indicates the updated specific carrier name returned by TelephonyManager.getSimSpecificCarrierIdName()
.
it's a user-facing name of the specific carrier id EXTRA_SPECIFIC_CARRIER_ID
e.g, Tracfone-AT&T
Value: "android.telephony.extra.SPECIFIC_CARRIER_NAME"
EXTRA_STATE
static val EXTRA_STATE: String
The lookup key used with the ACTION_PHONE_STATE_CHANGED
broadcast for a String containing the new call state.
Retrieve with android.content.Intent#getStringExtra(String)
.
Value: "state"
EXTRA_SUBSCRIPTION_ID
static val EXTRA_SUBSCRIPTION_ID: String
An int extra used with ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED
to indicate the subscription which has changed; or in general whenever a subscription ID needs specified.
Value: "android.telephony.extra.SUBSCRIPTION_ID"
EXTRA_VOICEMAIL_NUMBER
static val EXTRA_VOICEMAIL_NUMBER: String
The voicemail number.
Value: "android.telephony.extra.VOICEMAIL_NUMBER"
INCLUDE_LOCATION_DATA_COARSE
static val INCLUDE_LOCATION_DATA_COARSE: Int
Include coarse location data. Indicates whether the caller would not like to receive location related information which will be sent if the caller already possess android.Manifest.permission#ACCESS_COARSE_LOCATION
and do not renounce the permissions.
Value: 1
INCLUDE_LOCATION_DATA_FINE
static val INCLUDE_LOCATION_DATA_FINE: Int
Include fine location data. Indicates whether the caller would not like to receive location related information which will be sent if the caller already possess android.Manifest.permission#ACCESS_FINE_LOCATION
and do not renounce the permissions.
Value: 2
INCLUDE_LOCATION_DATA_NONE
static val INCLUDE_LOCATION_DATA_NONE: Int
Specifies to not include any location related data. Indicates whether the caller would not like to receive location related information which will be sent if the caller already possess android.Manifest.permission#ACCESS_COARSE_LOCATION
and do not renounce the permissions.
Value: 0
METADATA_HIDE_VOICEMAIL_SETTINGS_MENU
static val METADATA_HIDE_VOICEMAIL_SETTINGS_MENU: String
A boolean meta-data value indicating whether the voicemail settings should be hidden in the call settings page launched by android.telecom.TelecomManager#ACTION_SHOW_CALL_SETTINGS
. Dialer implementations (see android.telecom.TelecomManager#getDefaultDialerPackage()
) which would also like to manage voicemail settings should set this meta-data to true
in the manifest registration of their application.
Value: "android.telephony.HIDE_VOICEMAIL_SETTINGS_MENU"
MULTISIM_ALLOWED
static val MULTISIM_ALLOWED: Int
The usage of multiple SIM cards at the same time to register on the network (e.g. Dual Standby or Dual Active) is supported.
Value: 0
MULTISIM_NOT_SUPPORTED_BY_CARRIER
static val MULTISIM_NOT_SUPPORTED_BY_CARRIER: Int
The usage of multiple SIM cards at the same time to register on the network (e.g. Dual Standby or Dual Active) is supported by the hardware, but restricted by the carrier.
Value: 2
MULTISIM_NOT_SUPPORTED_BY_HARDWARE
static val MULTISIM_NOT_SUPPORTED_BY_HARDWARE: Int
The usage of multiple SIM cards at the same time to register on the network (e.g. Dual Standby or Dual Active) is not supported by the hardware.
Value: 1
NETWORK_SELECTION_MODE_AUTO
static val NETWORK_SELECTION_MODE_AUTO: Int
Value: 1
NETWORK_SELECTION_MODE_MANUAL
static val NETWORK_SELECTION_MODE_MANUAL: Int
Value: 2
NETWORK_SELECTION_MODE_UNKNOWN
static val NETWORK_SELECTION_MODE_UNKNOWN: Int
Value: 0
NETWORK_TYPE_1xRTT
static val NETWORK_TYPE_1xRTT: Int
Current network is 1xRTT
Value: 7
NETWORK_TYPE_BITMASK_1xRTT
static val NETWORK_TYPE_BITMASK_1xRTT: Long
network type bitmask indicating the support of radio tech 1xRTT.
Value: 64L
NETWORK_TYPE_BITMASK_CDMA
static val NETWORK_TYPE_BITMASK_CDMA: Long
network type bitmask indicating the support of radio tech CDMA(IS95A/IS95B).
Value: 8L
NETWORK_TYPE_BITMASK_EDGE
static val NETWORK_TYPE_BITMASK_EDGE: Long
network type bitmask indicating the support of radio tech EDGE.
Value: 2L
NETWORK_TYPE_BITMASK_EHRPD
static val NETWORK_TYPE_BITMASK_EHRPD: Long
network type bitmask indicating the support of radio tech EHRPD.
Value: 8192L
NETWORK_TYPE_BITMASK_EVDO_0
static val NETWORK_TYPE_BITMASK_EVDO_0: Long
network type bitmask indicating the support of radio tech EVDO 0.
Value: 16L
NETWORK_TYPE_BITMASK_EVDO_A
static val NETWORK_TYPE_BITMASK_EVDO_A: Long
network type bitmask indicating the support of radio tech EVDO A.
Value: 32L
NETWORK_TYPE_BITMASK_EVDO_B
static val NETWORK_TYPE_BITMASK_EVDO_B: Long
network type bitmask indicating the support of radio tech EVDO B.
Value: 2048L
NETWORK_TYPE_BITMASK_GPRS
static val NETWORK_TYPE_BITMASK_GPRS: Long
network type bitmask indicating the support of radio tech GPRS.
Value: 1L
NETWORK_TYPE_BITMASK_GSM
static val NETWORK_TYPE_BITMASK_GSM: Long
network type bitmask indicating the support of radio tech GSM.
Value: 32768L
NETWORK_TYPE_BITMASK_HSDPA
static val NETWORK_TYPE_BITMASK_HSDPA: Long
network type bitmask indicating the support of radio tech HSDPA.
Value: 128L
NETWORK_TYPE_BITMASK_HSPA
static val NETWORK_TYPE_BITMASK_HSPA: Long
network type bitmask indicating the support of radio tech HSPA.
Value: 512L
NETWORK_TYPE_BITMASK_HSPAP
static val NETWORK_TYPE_BITMASK_HSPAP: Long
network type bitmask indicating the support of radio tech HSPAP.
Value: 16384L
NETWORK_TYPE_BITMASK_HSUPA
static val NETWORK_TYPE_BITMASK_HSUPA: Long
network type bitmask indicating the support of radio tech HSUPA.
Value: 256L
NETWORK_TYPE_BITMASK_IWLAN
static val NETWORK_TYPE_BITMASK_IWLAN: Long
network type bitmask indicating the support of radio tech IWLAN.
Value: 131072L
NETWORK_TYPE_BITMASK_LTE
static val NETWORK_TYPE_BITMASK_LTE: Long
network type bitmask indicating the support of radio tech LTE.
Value: 4096L
NETWORK_TYPE_BITMASK_LTE_CA
static valNETWORK_TYPE_BITMASK_LTE_CA: Long
Deprecated: Please use NETWORK_TYPE_BITMASK_LTE
instead. Deprecated in Android U.
NOT USED; this bitmask is exposed accidentally. If used, will be converted to NETWORK_TYPE_BITMASK_LTE
. network type bitmask indicating the support of radio tech LTE CA (carrier aggregation).
Value: 262144L
NETWORK_TYPE_BITMASK_NR
static val NETWORK_TYPE_BITMASK_NR: Long
network type bitmask indicating the support of radio tech NR(New Radio) 5G.
Value: 524288L
NETWORK_TYPE_BITMASK_TD_SCDMA
static val NETWORK_TYPE_BITMASK_TD_SCDMA: Long
network type bitmask indicating the support of radio tech TD_SCDMA.
Value: 65536L
NETWORK_TYPE_BITMASK_UMTS
static val NETWORK_TYPE_BITMASK_UMTS: Long
network type bitmask indicating the support of radio tech UMTS.
Value: 4L
NETWORK_TYPE_BITMASK_UNKNOWN
static val NETWORK_TYPE_BITMASK_UNKNOWN: Long
network type bitmask unknown.
Value: 0L
NETWORK_TYPE_CDMA
static val NETWORK_TYPE_CDMA: Int
Current network is CDMA: Either IS95A or IS95B
Value: 4
NETWORK_TYPE_EDGE
static val NETWORK_TYPE_EDGE: Int
Current network is EDGE
Value: 2
NETWORK_TYPE_EHRPD
static val NETWORK_TYPE_EHRPD: Int
Current network is eHRPD
Value: 14
NETWORK_TYPE_EVDO_0
static val NETWORK_TYPE_EVDO_0: Int
Current network is EVDO revision 0
Value: 5
NETWORK_TYPE_EVDO_A
static val NETWORK_TYPE_EVDO_A: Int
Current network is EVDO revision A
Value: 6
NETWORK_TYPE_EVDO_B
static val NETWORK_TYPE_EVDO_B: Int
Current network is EVDO revision B
Value: 12
NETWORK_TYPE_GPRS
static val NETWORK_TYPE_GPRS: Int
Current network is GPRS
Value: 1
NETWORK_TYPE_GSM
static val NETWORK_TYPE_GSM: Int
Current network is GSM
Value: 16
NETWORK_TYPE_HSDPA
static val NETWORK_TYPE_HSDPA: Int
Current network is HSDPA
Value: 8
NETWORK_TYPE_HSPA
static val NETWORK_TYPE_HSPA: Int
Current network is HSPA
Value: 10
NETWORK_TYPE_HSPAP
static val NETWORK_TYPE_HSPAP: Int
Current network is HSPA+
Value: 15
NETWORK_TYPE_HSUPA
static val NETWORK_TYPE_HSUPA: Int
Current network is HSUPA
Value: 9
NETWORK_TYPE_IDEN
static valNETWORK_TYPE_IDEN: Int
Deprecated: Legacy network type no longer being used starting in Android U.
Current network is iDen
Value: 11
NETWORK_TYPE_IWLAN
static val NETWORK_TYPE_IWLAN: Int
Current network is IWLAN
Value: 18
NETWORK_TYPE_LTE
static val NETWORK_TYPE_LTE: Int
Current network is LTE
Value: 13
NETWORK_TYPE_NR
static val NETWORK_TYPE_NR: Int
Current network is NR (New Radio) 5G. This will only be returned for 5G SA. For 5G NSA, the network type will be NETWORK_TYPE_LTE
.
Value: 20
NETWORK_TYPE_TD_SCDMA
static val NETWORK_TYPE_TD_SCDMA: Int
Current network is TD_SCDMA
Value: 17
NETWORK_TYPE_UMTS
static val NETWORK_TYPE_UMTS: Int
Current network is UMTS
Value: 3
NETWORK_TYPE_UNKNOWN
static val NETWORK_TYPE_UNKNOWN: Int
Network type is unknown
Value: 0
PREMIUM_CAPABILITY_PRIORITIZE_LATENCY
static val PREMIUM_CAPABILITY_PRIORITIZE_LATENCY: Int
A premium capability that boosts the network to allow for real-time interactive traffic by prioritizing low latency communication. Corresponds to NetworkCapabilities.NET_CAPABILITY_PRIORITIZE_LATENCY
.
Value: 34
PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_IN_PROGRESS
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_IN_PROGRESS: Int
Purchase premium capability failed because a request was already made and is in progress. This may have been requested by either the same app or another app. Subsequent attempts will return the same error until the previous request completes.
Value: 4
PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_PURCHASED
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_PURCHASED: Int
Purchase premium capability failed because it is already purchased and available. Subsequent attempts will return the same error until the performance boost expires.
Value: 3
PURCHASE_PREMIUM_CAPABILITY_RESULT_CARRIER_DISABLED
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_CARRIER_DISABLED: Int
Purchase premium capability failed because the carrier disabled or does not support the capability, as specified in CarrierConfigManager.KEY_SUPPORTED_PREMIUM_CAPABILITIES_INT_ARRAY
. Subsequent attempts will return the same error until the carrier enables the feature.
Value: 7
PURCHASE_PREMIUM_CAPABILITY_RESULT_CARRIER_ERROR
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_CARRIER_ERROR: Int
Purchase premium capability failed because the carrier app did not indicate success. Subsequent attempts will be throttled for the amount of time specified by KEY_PREMIUM_CAPABILITY_PURCHASE_CONDITION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG
and return PURCHASE_PREMIUM_CAPABILITY_RESULT_THROTTLED
.
Value: 8
PURCHASE_PREMIUM_CAPABILITY_RESULT_ENTITLEMENT_CHECK_FAILED
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_ENTITLEMENT_CHECK_FAILED: Int
Purchase premium capability failed because the entitlement check failed. Subsequent attempts will be throttled for the amount of time specified by KEY_PREMIUM_CAPABILITY_PURCHASE_CONDITION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG
and return PURCHASE_PREMIUM_CAPABILITY_RESULT_THROTTLED
. Throttling will be reevaluated when the network is no longer congested.
Value: 13
PURCHASE_PREMIUM_CAPABILITY_RESULT_FEATURE_NOT_SUPPORTED
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_FEATURE_NOT_SUPPORTED: Int
Purchase premium capability failed because the device does not support the feature. Subsequent attempts will return the same error.
Value: 10
PURCHASE_PREMIUM_CAPABILITY_RESULT_NETWORK_NOT_AVAILABLE
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_NETWORK_NOT_AVAILABLE: Int
Purchase premium capability failed because the network is not available. Subsequent attempts will return the same error until network conditions change.
Value: 12
PURCHASE_PREMIUM_CAPABILITY_RESULT_NOT_DEFAULT_DATA_SUBSCRIPTION
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_NOT_DEFAULT_DATA_SUBSCRIPTION: Int
Purchase premium capability failed because the request was not made on the default data subscription, indicated by SubscriptionManager.getDefaultDataSubscriptionId()
. Subsequent attempts will return the same error until the request is made on the default data subscription.
Value: 14
PURCHASE_PREMIUM_CAPABILITY_RESULT_NOT_FOREGROUND
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_NOT_FOREGROUND: Int
Purchase premium capability failed because the requesting application is not in the foreground. Subsequent attempts will return the same error until the requesting application moves to the foreground.
Value: 5
PURCHASE_PREMIUM_CAPABILITY_RESULT_PENDING_NETWORK_SETUP
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_PENDING_NETWORK_SETUP: Int
Purchase premium capability was successful and is waiting for the network to setup the slicing configuration. If the setup is complete within the time specified by CarrierConfigManager.KEY_PREMIUM_CAPABILITY_NETWORK_SETUP_TIME_MILLIS_LONG
, subsequent requests will return PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_PURCHASED
until the purchase expires. If the setup is not complete within the time specified above, applications can request the premium capability again.
Value: 15
PURCHASE_PREMIUM_CAPABILITY_RESULT_REQUEST_FAILED
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_REQUEST_FAILED: Int
Purchase premium capability failed because the telephony service is unavailable or there was an error in the phone process. Subsequent attempts will return the same error until request conditions are satisfied.
Value: 11
PURCHASE_PREMIUM_CAPABILITY_RESULT_SUCCESS
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_SUCCESS: Int
Purchase premium capability request was successful. Once the purchase result is successful, the network must set up a slicing configuration for the purchased premium capability within the timeout specified by CarrierConfigManager.KEY_PREMIUM_CAPABILITY_NETWORK_SETUP_TIME_MILLIS_LONG
. During the setup time, subsequent attempts will return PURCHASE_PREMIUM_CAPABILITY_RESULT_PENDING_NETWORK_SETUP
. After setup is complete, subsequent attempts will return PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_PURCHASED
until the boost expires. The expiry time is determined by the type or duration of boost purchased from the carrier, provided at CarrierConfigManager.KEY_PREMIUM_CAPABILITY_PURCHASE_URL_STRING
.
Value: 1
PURCHASE_PREMIUM_CAPABILITY_RESULT_THROTTLED
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_THROTTLED: Int
Purchase premium capability failed because the request is throttled. If purchasing premium capabilities is throttled, it will be for the amount of time specified by KEY_PREMIUM_CAPABILITY_PURCHASE_CONDITION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG
. If displaying the performance boost notification is throttled, it will be for the amount of time specified by KEY_PREMIUM_CAPABILITY_NOTIFICATION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG
. We will show the performance boost notification to the user up to the daily and monthly maximum number of times specified by CarrierConfigManager.KEY_PREMIUM_CAPABILITY_MAXIMUM_DAILY_NOTIFICATION_COUNT_INT
and CarrierConfigManager.KEY_PREMIUM_CAPABILITY_MAXIMUM_MONTHLY_NOTIFICATION_COUNT_INT
. Subsequent attempts will return the same error until the request is no longer throttled or throttling conditions change.
Value: 2
PURCHASE_PREMIUM_CAPABILITY_RESULT_TIMEOUT
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_TIMEOUT: Int
Purchase premium capability failed because we did not receive a response from the user for the performance boost notification within the time specified by CarrierConfigManager.KEY_PREMIUM_CAPABILITY_NOTIFICATION_DISPLAY_TIMEOUT_MILLIS_LONG
. The performance boost notification will be automatically dismissed and subsequent attempts will be throttled for the amount of time specified by KEY_PREMIUM_CAPABILITY_NOTIFICATION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG
and return PURCHASE_PREMIUM_CAPABILITY_RESULT_THROTTLED
.
Value: 9
PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_CANCELED
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_CANCELED: Int
Purchase premium capability failed because the user canceled the operation. Subsequent attempts will be throttled for the amount of time specified by KEY_PREMIUM_CAPABILITY_NOTIFICATION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG
and return PURCHASE_PREMIUM_CAPABILITY_RESULT_THROTTLED
.
Value: 6
PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_DISABLED
static val PURCHASE_PREMIUM_CAPABILITY_RESULT_USER_DISABLED: Int
Purchase premium capability failed because the user disabled the feature. Subsequent attempts will be throttled for the amount of time specified by KEY_PREMIUM_CAPABILITY_NOTIFICATION_BACKOFF_HYSTERESIS_TIME_MILLIS_LONG
and return PURCHASE_PREMIUM_CAPABILITY_RESULT_THROTTLED
.
Value: 16
SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION
static val SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION: Int
The subscription is not valid. It must be an active opportunistic subscription.
Value: 2
SET_OPPORTUNISTIC_SUB_NO_OPPORTUNISTIC_SUB_AVAILABLE
static val SET_OPPORTUNISTIC_SUB_NO_OPPORTUNISTIC_SUB_AVAILABLE: Int
The subscription is not valid. It must be an opportunistic subscription.
Value: 3
SET_OPPORTUNISTIC_SUB_REMOTE_SERVICE_EXCEPTION
static val SET_OPPORTUNISTIC_SUB_REMOTE_SERVICE_EXCEPTION: Int
Subscription service happened remote exception.
Value: 4
SET_OPPORTUNISTIC_SUB_SUCCESS
static val SET_OPPORTUNISTIC_SUB_SUCCESS: Int
No error. Operation succeeded.
Value: 0
SET_OPPORTUNISTIC_SUB_VALIDATION_FAILED
static val SET_OPPORTUNISTIC_SUB_VALIDATION_FAILED: Int
Validation failed when trying to switch to preferred subscription.
Value: 1
SIM_STATE_ABSENT
static val SIM_STATE_ABSENT: Int
SIM card state: no SIM card is available in the device
Value: 1
SIM_STATE_CARD_IO_ERROR
static val SIM_STATE_CARD_IO_ERROR: Int
SIM card state: SIM Card Error, present but faulty
Value: 8
SIM_STATE_CARD_RESTRICTED
static val SIM_STATE_CARD_RESTRICTED: Int
SIM card state: SIM Card restricted, present but not usable due to carrier restrictions.
Value: 9
SIM_STATE_NETWORK_LOCKED
static val SIM_STATE_NETWORK_LOCKED: Int
SIM card state: Locked: requires a network PIN to unlock
Value: 4
SIM_STATE_NOT_READY
static val SIM_STATE_NOT_READY: Int
SIM card state: SIM Card is NOT READY
Value: 6
SIM_STATE_PERM_DISABLED
static val SIM_STATE_PERM_DISABLED: Int
SIM card state: SIM Card Error, permanently disabled
Value: 7
SIM_STATE_PIN_REQUIRED
static val SIM_STATE_PIN_REQUIRED: Int
SIM card state: Locked: requires the user's SIM PIN to unlock
Value: 2
SIM_STATE_PUK_REQUIRED
static val SIM_STATE_PUK_REQUIRED: Int
SIM card state: Locked: requires the user's SIM PUK to unlock
Value: 3
SIM_STATE_UNKNOWN
static val SIM_STATE_UNKNOWN: Int
SIM card state: Unknown. Signifies that the SIM is in transition between states. For example, when the user inputs the SIM pin under PIN_REQUIRED state, a query for sim status returns this state before turning to SIM_STATE_READY. These are the ordinal value of IccCardConstants.State.
Value: 0
UNINITIALIZED_CARD_ID
static val UNINITIALIZED_CARD_ID: Int
A UICC card identifier used before the UICC card is loaded. See getCardIdForDefaultEuicc()
and UiccCardInfo.getCardId()
.
Note that once the UICC card is loaded, the card ID may become UNSUPPORTED_CARD_ID
.
Value: -2
UNKNOWN_CARRIER_ID
static val UNKNOWN_CARRIER_ID: Int
An unknown carrier id. It could either be subscription unavailable or the subscription carrier cannot be recognized. Unrecognized carriers here means MCC+MNC
cannot be identified.
Value: -1
UNSUPPORTED_CARD_ID
static val UNSUPPORTED_CARD_ID: Int
A UICC card identifier used if the device does not support the operation. For example, getCardIdForDefaultEuicc()
returns this value if the device has no eUICC, or the eUICC cannot be read.
Value: -1
UPDATE_AVAILABLE_NETWORKS_ABORTED
static val UPDATE_AVAILABLE_NETWORKS_ABORTED: Int
The request is aborted.
Value: 2
UPDATE_AVAILABLE_NETWORKS_DISABLE_MODEM_FAIL
static val UPDATE_AVAILABLE_NETWORKS_DISABLE_MODEM_FAIL: Int
Disable modem fail.
Value: 5
UPDATE_AVAILABLE_NETWORKS_ENABLE_MODEM_FAIL
static val UPDATE_AVAILABLE_NETWORKS_ENABLE_MODEM_FAIL: Int
Enable modem fail.
Value: 6
UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS
static val UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS: Int
The parameter passed in is invalid.
Value: 3
UPDATE_AVAILABLE_NETWORKS_MULTIPLE_NETWORKS_NOT_SUPPORTED
static val UPDATE_AVAILABLE_NETWORKS_MULTIPLE_NETWORKS_NOT_SUPPORTED: Int
Carrier app does not support multiple available networks.
Value: 7
UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE
static val UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE: Int
No carrier privilege.
Value: 4
UPDATE_AVAILABLE_NETWORKS_NO_OPPORTUNISTIC_SUB_AVAILABLE
static val UPDATE_AVAILABLE_NETWORKS_NO_OPPORTUNISTIC_SUB_AVAILABLE: Int
The subscription is not valid. It must be an opportunistic subscription.
Value: 8
UPDATE_AVAILABLE_NETWORKS_REMOTE_SERVICE_EXCEPTION
static val UPDATE_AVAILABLE_NETWORKS_REMOTE_SERVICE_EXCEPTION: Int
There is no OpportunisticNetworkService.
Value: 9
UPDATE_AVAILABLE_NETWORKS_SERVICE_IS_DISABLED
static val UPDATE_AVAILABLE_NETWORKS_SERVICE_IS_DISABLED: Int
OpportunisticNetworkService is disabled.
Value: 10
UPDATE_AVAILABLE_NETWORKS_SUCCESS
static val UPDATE_AVAILABLE_NETWORKS_SUCCESS: Int
No error. Operation succeeded.
Value: 0
UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE
static val UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE: Int
There is a unknown failure happened.
Value: 1
USSD_ERROR_SERVICE_UNAVAIL
static val USSD_ERROR_SERVICE_UNAVAIL: Int
Failure code returned when a USSD request has failed to execute because the Telephony service is unavailable.
Returned via TelephonyManager.UssdResponseCallback.onReceiveUssdResponseFailed(
.
Value: -2
USSD_RETURN_FAILURE
static val USSD_RETURN_FAILURE: Int
Failed code returned when the mobile network has failed to complete a USSD request.
Returned via TelephonyManager.UssdResponseCallback.onReceiveUssdResponseFailed(
.
Value: -1
VVM_TYPE_CVVM
static val VVM_TYPE_CVVM: String
A flavor of OMTP protocol with a different mobile originated (MO) format
Value: "vvm_type_cvvm"
VVM_TYPE_OMTP
static val VVM_TYPE_OMTP: String
The OMTP protocol.
Value: "vvm_type_omtp"
Public methods
canChangeDtmfToneLength
open fun canChangeDtmfToneLength(): Boolean
Whether the device supports configuring the DTMF tone length.
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if the DTMF tone length can be changed, and false otherwise. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
clearSignalStrengthUpdateRequest
open fun clearSignalStrengthUpdateRequest(request: SignalStrengthUpdateRequest): Unit
Clear a SignalStrengthUpdateRequest
from the system.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see TelephonyManager.hasCarrierPrivileges
).
If the given request was not set before, this operation is a no-op.
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
request |
SignalStrengthUpdateRequest: the SignalStrengthUpdateRequest to be cleared from the System This value cannot be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
createForPhoneAccountHandle
open fun createForPhoneAccountHandle(phoneAccountHandle: PhoneAccountHandle!): TelephonyManager?
Create a new TelephonyManager object pinned to the subscription ID associated with the given phone account.
Return | |
---|---|
TelephonyManager? |
a TelephonyManager that uses the given phone account for all calls, or null if the phone account does not correspond to a valid subscription ID. |
createForSubscriptionId
open fun createForSubscriptionId(subId: Int): TelephonyManager!
Create a new TelephonyManager object pinned to the given subscription ID.
Return | |
---|---|
TelephonyManager! |
a TelephonyManager that uses the given subId for all calls. |
doesSwitchMultiSimConfigTriggerReboot
open fun doesSwitchMultiSimConfigTriggerReboot(): Boolean
Get whether making changes to modem configurations by switchMultiSimConfig(int)
will trigger device reboot. The modem configuration change refers to switching from single SIM configuration to DSDS or the other way around.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if reboot will be triggered after making changes to modem configurations, otherwise return false . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getActiveModemCount
open fun getActiveModemCount(): Int
Returns the number of logical modems currently configured to be activated. Returns 0 if none of voice, sms, data is not supported Returns 1 for Single standby mode (Single SIM functionality). Returns 2 for Dual standby mode (Dual SIM functionality). Returns 3 for Tri standby mode (Tri SIM functionality).
getAllCellInfo
open fun getAllCellInfo(): MutableList<CellInfo!>!
Requests all available cell information from all radios on the device including the camped/registered, serving, and neighboring cells.
The response can include one or more CellInfoGsm
, CellInfoCdma
, CellInfoTdscdma
, CellInfoLte
, and CellInfoWcdma
objects, in any combination. It is typical to see instances of one or more of any these in the list. In addition, zero or more of the returned objects may be considered registered; that is, their CellInfo.isRegistered()
methods may return true, indicating that the cell is being used or would be used for signaling communication if necessary.
Beginning with Android Q
, if this API results in a change of the cached CellInfo, that change will be reported via onCellInfoChanged()
.
Apps targeting Android Q
or higher will no longer trigger a refresh of the cached CellInfo by invoking this API. Instead, those apps will receive the latest cached results, which may not be current. Apps targeting Android Q
or higher that wish to request updated CellInfo should call requestCellInfoUpdate()
; however, in all cases, updates will be rate-limited and are not guaranteed. To determine the recency of CellInfo data, callers should check CellInfo#getTimeStamp()
.
This method returns valid data for devices with FEATURE_TELEPHONY
. In cases where only partial information is available for a particular CellInfo entry, unavailable fields will be reported as android.telephony.CellInfo#UNAVAILABLE
. All reported cells will include at least a valid set of technology-specific identification info and a power level measurement.
This method is preferred over using getCellLocation()
.
Requires android.Manifest.permission#ACCESS_FINE_LOCATION
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
MutableList<CellInfo!>! |
List of android.telephony.CellInfo ; null if cell information is unavailable. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getAllowedNetworkTypesForReason
open fun getAllowedNetworkTypesForReason(reason: Int): Long
Get the allowed network types for certain reason. getAllowedNetworkTypesForReason
returns allowed network type for a specific reason.
Requires permission: android.Manifest.READ_PRIVILEGED_PHONE_STATE or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the TelephonyManager#CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK feature which can be detected using TelephonyManager.isRadioInterfaceCapabilitySupported(String)
.
Parameters | |
---|---|
reason |
Int: the reason the allowed network type change is taking place Value is android.telephony.TelephonyManager#ALLOWED_NETWORK_TYPES_REASON_USER , android.telephony.TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_POWER, android.telephony.TelephonyManager#ALLOWED_NETWORK_TYPES_REASON_CARRIER , android.telephony.TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G, or android.telephony.TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_TEST |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if the Telephony process is not currently available. |
java.lang.IllegalArgumentException |
if invalid AllowedNetworkTypesReason is passed. |
java.lang.SecurityException |
if the caller does not have the required permission/privileges |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getCallComposerStatus
open fun getCallComposerStatus(): Int
Get the user-set status for enriched calling with call composer.
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Int |
the user-set status for enriched calling with call composer, either of CALL_COMPOSER_STATUS_ON or CALL_COMPOSER_STATUS_OFF . Value is android.telephony.TelephonyManager#CALL_COMPOSER_STATUS_ON , android.telephony.TelephonyManager#CALL_COMPOSER_STATUS_OFF , or android.telephony.TelephonyManager#CALL_COMPOSER_STATUS_BUSINESS_ONLY |
Exceptions | |
---|---|
java.lang.SecurityException |
if the caller does not have the permission. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
getCallState
open fungetCallState(): Int
Deprecated: Use getCallStateForSubscription
to retrieve the call state for a specific telephony subscription (which allows carrier privileged apps), TelephonyCallback.CallStateListener
for real-time call state updates, or TelecomManager.isInCall()
, which supplies an aggregate "in call" state for the entire device.
Returns the state of all calls on the device.
This method considers not only calls in the Telephony stack, but also calls via other android.telecom.ConnectionService
implementations.
Note: The call state returned via this method may differ from what is reported by android.telephony.TelephonyCallback.CallStateListener#onCallStateChanged(int)
, as that callback only considers Telephony (mobile) calls.
Requires Permission: READ_PHONE_STATE
for applications targeting API level 31+.
Return | |
---|---|
Int |
the current call state. Value is android.telephony.TelephonyManager#CALL_STATE_IDLE , android.telephony.TelephonyManager#CALL_STATE_RINGING , or android.telephony.TelephonyManager#CALL_STATE_OFFHOOK |
getCallStateForSubscription
open fun getCallStateForSubscription(): Int
Retrieve the call state for a specific subscription that was specified when this TelephonyManager instance was created.
Requires Permission: READ_PHONE_STATE
or that the calling application has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Int |
The call state of the subscription associated with this TelephonyManager instance. Value is android.telephony.TelephonyManager#CALL_STATE_IDLE , android.telephony.TelephonyManager#CALL_STATE_RINGING , or android.telephony.TelephonyManager#CALL_STATE_OFFHOOK |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
getCardIdForDefaultEuicc
open fun getCardIdForDefaultEuicc(): Int
Get the card ID of the default eUICC card. If the eUICCs have not yet been loaded, returns UNINITIALIZED_CARD_ID
. If there is no eUICC or the device does not support card IDs for eUICCs, returns UNSUPPORTED_CARD_ID
.
The card ID is a unique identifier associated with a UICC or eUICC card. Card IDs are unique to a device, and always refer to the same UICC or eUICC card unless the device goes through a factory reset.
Requires the PackageManager#FEATURE_TELEPHONY_EUICC
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Int |
card ID of the default eUICC card, if loaded. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_EUICC . |
getCarrierConfig
open fun getCarrierConfig(): PersistableBundle!
Returns the carrier config of the subscription ID pinned to the TelephonyManager. If an invalid subscription ID is pinned to the TelephonyManager, the returned config will contain default values.
This method may take several seconds to complete, so it should only be called from a worker thread.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
This method may take several seconds to complete, so it should only be called from a worker thread.
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getCarrierIdFromSimMccMnc
open fun getCarrierIdFromSimMccMnc(): Int
Returns carrier id based on sim MCCMNC (returned by getSimOperator()
) only. This is used for fallback when configurations/logic for exact carrier id getSimCarrierId()
are not found. Android carrier id table here can be updated out-of-band, its possible a MVNO (Mobile Virtual Network Operator) carrier was not fully recognized and assigned to its MNO (Mobile Network Operator) carrier id by default. After carrier id table update, a new carrier id was assigned. If apps don't take the update with the new id, it might be helpful to always fallback by using carrier id based on MCCMNC if there is no match.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Int |
matching carrier id from sim MCCMNC. Return UNKNOWN_CARRIER_ID if the subscription is unavailable or the carrier cannot be identified. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getCarrierRestrictionStatus
open fun getCarrierRestrictionStatus(
executor: Executor,
resultListener: Consumer<Int!>
): Unit
Get the carrier restriction status of the device.
To fetch the carrier restriction status of the device the calling application needs to be allowlisted to Android at here. The calling application also needs the READ_PHONE_STATE permission. The return value of the API is as follows.
- return
CARRIER_RESTRICTION_STATUS_RESTRICTED_TO_CALLER
if the caller and the device locked by the network are same - return
CARRIER_RESTRICTION_STATUS_RESTRICTED
if the caller and the device locked by the network are different - return
CARRIER_RESTRICTION_STATUS_NOT_RESTRICTED
if the device is not locked - return
CARRIER_RESTRICTION_STATUS_UNKNOWN
if the device locking state is unavailable or radio does not supports the feature
Requires the
PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
. Requires
android.Manifest.permission#READ_BASIC_PHONE_STATE
or android.Manifest.permission#READ_PHONE_STATE
Parameters | |
---|---|
executor |
Executor: The executor on which the result listener will be called. This value cannot be null . |
resultListener |
Consumer<Int!>: Consumer that will be called with the carrier restriction status result fetched from the radio This value cannot be null . Value is android.telephony.TelephonyManager#CARRIER_RESTRICTION_STATUS_UNKNOWN , android.telephony.TelephonyManager#CARRIER_RESTRICTION_STATUS_NOT_RESTRICTED , android.telephony.TelephonyManager#CARRIER_RESTRICTION_STATUS_RESTRICTED , or android.telephony.TelephonyManager#CARRIER_RESTRICTION_STATUS_RESTRICTED_TO_CALLER |
Exceptions | |
---|---|
java.lang.SecurityException |
if the caller does not have the required permission/privileges or if the caller is not pre-registered. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getCellLocation
open fungetCellLocation(): CellLocation!
Deprecated: use getAllCellInfo
instead, which returns a superset of this API.
Returns the current location of the device.
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.
Requires android.Manifest.permission#ACCESS_FINE_LOCATION
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
CellLocation! |
Current location of the device or null if not available. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getDataActivity
open fun getDataActivity(): Int
Returns a constant indicating the type of activity on a data connection (cellular).
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
getDataNetworkType
open fun getDataNetworkType(): Int
Returns a constant indicating the radio technology (network type) currently in use on the device for data transmission. If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getActiveDataSubscriptionId()
. Note: Before SubscriptionManager.getActiveDataSubscriptionId()
was introduced in API level 30, it was applied to SubscriptionManager.getDefaultDataSubscriptionId()
which may be different now from SubscriptionManager.getActiveDataSubscriptionId()
, e.g. when opportunistic network is providing cellular internet connection to the user.
Requires Permission: READ_PHONE_STATE
or READ_BASIC_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
or android.Manifest.permission#READ_BASIC_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
See Also
#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
#NETWORK_TYPE_HSPAP
#NETWORK_TYPE_NR
getDataState
open fun getDataState(): Int
Returns a constant indicating the current data connection state (cellular).
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
getDeviceId
open fungetDeviceId(): String!
Deprecated: Use #getImei which returns IMEI for GSM or #getMeid which returns MEID for CDMA.
Returns the unique device ID, for example, the IMEI for GSM and the MEID or ESN for CDMA phones. Return null if device ID is not available.
Starting with API level 29, persistent device identifiers are guarded behind additional restrictions, and apps are recommended to use resettable identifiers (see Best practices for unique identifiers). This method can be invoked if one of the following requirements is met:
- If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
- If the calling app is the device owner of a fully-managed device, a profile owner of an organization-owned device, or their delegates (see
android.app.admin.DevicePolicyManager#getEnrollmentSpecificId()
). - If the calling app has carrier privileges (see
hasCarrierPrivileges
) on any active subscription. - If the calling app is the default SMS role holder (see
android.app.role.RoleManager#isRoleHeld(java.lang.String)
).
If the calling app does not meet one of these requirements then this method will behave as follows:
- If the calling app's target SDK is API level 28 or lower and the app has the READ_PHONE_STATE permission then null is returned.
- If the calling app's target SDK is API level 28 or lower and the app does not have the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or higher, then a SecurityException is thrown.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
getDeviceId
open fungetDeviceId(slotIndex: Int): String!
Deprecated: Use #getImei which returns IMEI for GSM or #getMeid which returns MEID for CDMA.
Returns the unique device ID of a subscription, for example, the IMEI for GSM and the MEID for CDMA phones. Return null if device ID is not available.
Starting with API level 29, persistent device identifiers are guarded behind additional restrictions, and apps are recommended to use resettable identifiers (see Best practices for unique identifiers). This method can be invoked if one of the following requirements is met:
- If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
- If the calling app is the device owner of a fully-managed device, a profile owner of an organization-owned device, or their delegates (see
android.app.admin.DevicePolicyManager#getEnrollmentSpecificId()
). - If the calling app has carrier privileges (see
hasCarrierPrivileges
) on any active subscription. - If the calling app is the default SMS role holder (see
android.app.role.RoleManager#isRoleHeld(java.lang.String)
).
If the calling app does not meet one of these requirements then this method will behave as follows:
- If the calling app's target SDK is API level 28 or lower and the app has the READ_PHONE_STATE permission then null is returned.
- If the calling app's target SDK is API level 28 or lower and the app does not have the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or higher, then a SecurityException is thrown.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Parameters | |
---|---|
slotIndex |
Int: of which deviceID is returned |
getDeviceSoftwareVersion
open fun getDeviceSoftwareVersion(): String?
Returns the software version number for the device, for example, the IMEI/SV for GSM phones. Return null if the software version is not available.
Requires android.Manifest.permission#READ_PHONE_STATE
or android.Manifest.permission#READ_BASIC_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY . |
getEmergencyNumberList
open fun getEmergencyNumberList(): MutableMap<Int!, MutableList<EmergencyNumber!>!>
Get the emergency number list based on current locale, sim, default, modem and network.
In each returned list, the emergency number EmergencyNumber
coming from higher priority sources will be located at the smaller index; the priority order of sources are: EmergencyNumber.EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING
> EmergencyNumber.EMERGENCY_NUMBER_SOURCE_SIM
> EmergencyNumber.EMERGENCY_NUMBER_SOURCE_DATABASE
> EmergencyNumber.EMERGENCY_NUMBER_SOURCE_DEFAULT
> EmergencyNumber.EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG
The subscriptions which the returned list would be based on, are all the active subscriptions, no matter which subscription could be used to create TelephonyManager.
Requires permission android.Manifest.permission#READ_PHONE_STATE
or the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
MutableMap<Int!, MutableList<EmergencyNumber!>!> |
Map including the keys as the active subscription IDs (Note: if there is no active subscription, the key is SubscriptionManager.getDefaultSubscriptionId ) and the value as the list of EmergencyNumber ; empty Map if this information is not available; or throw a SecurityException if the caller does not have the permission. This value cannot be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
getEmergencyNumberList
open fun getEmergencyNumberList(categories: Int): MutableMap<Int!, MutableList<EmergencyNumber!>!>
Get the per-category emergency number list based on current locale, sim, default, modem and network.
In each returned list, the emergency number EmergencyNumber
coming from higher priority sources will be located at the smaller index; the priority order of sources are: EmergencyNumber.EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING
> EmergencyNumber.EMERGENCY_NUMBER_SOURCE_SIM
> EmergencyNumber.EMERGENCY_NUMBER_SOURCE_DATABASE
> EmergencyNumber.EMERGENCY_NUMBER_SOURCE_DEFAULT
> EmergencyNumber.EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG
The subscriptions which the returned list would be based on, are all the active subscriptions, no matter which subscription could be used to create TelephonyManager.
Requires permission android.Manifest.permission#READ_PHONE_STATE
or the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
MutableMap<Int!, MutableList<EmergencyNumber!>!> |
Map including the keys as the active subscription IDs (Note: if there is no active subscription, the key is SubscriptionManager.getDefaultSubscriptionId ) and the value as the list of EmergencyNumber ; empty Map if this information is not available; or throw a SecurityException if the caller does not have the permission. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if the Telephony process is not currently available. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
getEquivalentHomePlmns
open fun getEquivalentHomePlmns(): MutableList<String!>
Returns a list of the equivalent home PLMNs (EF_EHPLMN) from the USIM app.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
MutableList<String!> |
A list of equivalent home PLMNs. Returns an empty list if EF_EHPLMN is empty or does not exist on the SIM card. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if the Telephony process is not currently available. |
java.lang.SecurityException |
if the caller doesn't have the permission. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getForbiddenPlmns
open fun getForbiddenPlmns(): Array<String!>!
Returns an array of Forbidden PLMNs from the USIM App Returns null if the query fails.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Array<String!>! |
an array of forbidden PLMNs or null if not available |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getGroupIdLevel1
open fun getGroupIdLevel1(): String!
Returns the Group Identifier Level1 for a GSM phone. Return null if it is unavailable.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getIccAuthentication
open fun getIccAuthentication(
appType: Int,
authType: Int,
data: String!
): String!
Returns the response of authentication for the default subscription. Returns null if the authentication hasn't been successful
Requires one of the following permissions:
- READ_PRIVILEGED_PHONE_STATE
- the calling app has carrier privileges (see
hasCarrierPrivileges
). - the calling app has been granted the
Manifest.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER
permission.
Requires the
PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
appType |
Int: the icc application type, like APPTYPE_USIM |
authType |
Int: the authentication type, any one of AUTHTYPE_EAP_AKA or AUTHTYPE_EAP_SIM or AUTHTYPE_GBA_BOOTSTRAP or AUTHTYPE_GBA_NAF_KEY_EXTERNAL Value is android.telephony.TelephonyManager#AUTHTYPE_EAP_SIM , android.telephony.TelephonyManager#AUTHTYPE_EAP_AKA , android.telephony.TelephonyManager#AUTHTYPE_GBA_BOOTSTRAP , or android.telephony.TelephonyManager#AUTHTYPE_GBA_NAF_KEY_EXTERNAL |
data |
String!: authentication challenge data, base64 encoded. See 3GPP TS 31.102 7.1.2 for more details. |
Return | |
---|---|
String! |
the response of authentication. This value will be null in the following cases: Authentication error, incorrect MAC Authentication error, security context not supported Key freshness failure Authentication error, no memory space available Authentication error, no memory space available in EFMUK |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION or doesn't support given authType. |
getImei
open fun getImei(): String!
Returns the IMEI (International Mobile Equipment Identity). Return null if IMEI is not available. See getImei(int)
for details on the required permissions and behavior when the caller does not hold sufficient permissions.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
getImei
open fun getImei(slotIndex: Int): String!
Returns the IMEI (International Mobile Equipment Identity). Return null if IMEI is not available.
Starting with API level 29, persistent device identifiers are guarded behind additional restrictions, and apps are recommended to use resettable identifiers (see Best practices for unique identifiers). This method can be invoked if one of the following requirements is met:
- If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
- If the calling app is the device owner of a fully-managed device, a profile owner of an organization-owned device, or their delegates (see
android.app.admin.DevicePolicyManager#getEnrollmentSpecificId()
). - If the calling app has carrier privileges (see
hasCarrierPrivileges
) on any active subscription. - If the calling app is the default SMS role holder (see
android.app.role.RoleManager#isRoleHeld(java.lang.String)
). - If the calling app has been granted the
Manifest.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER
permission.
If the calling app does not meet one of these requirements then this method will behave as follows:
- If the calling app's target SDK is API level 28 or lower and the app has the READ_PHONE_STATE permission then null is returned.
- If the calling app's target SDK is API level 28 or lower and the app does not have the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or higher, then a SecurityException is thrown.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Parameters | |
---|---|
slotIndex |
Int: of which IMEI is returned |
getLine1Number
open fungetLine1Number(): String!
Deprecated: use SubscriptionManager.getPhoneNumber(int)
instead.
Returns the phone number string for line 1, for example, the MSISDN for a GSM phone for a particular subscription. Return null if it is unavailable.
The default SMS app can also use this.
Requires Permission: READ_SMS
, READ_PHONE_NUMBERS
, that the caller is the default SMS app, or that the caller has carrier privileges (see hasCarrierPrivileges
) for any API level. READ_PHONE_STATE
for apps targeting SDK API level 29 and below.
Requires android.Manifest.permission#READ_PHONE_STATE
or android.Manifest.permission#READ_SMS
or android.Manifest.permission#READ_PHONE_NUMBERS
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getManualNetworkSelectionPlmn
open fun getManualNetworkSelectionPlmn(): String
Get the PLMN chosen for Manual Network Selection if active. Return empty string if in automatic selection.
Requires Permission: READ_PRECISE_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
)
Requires android.Manifest.permission#READ_PRECISE_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
String |
manually selected network info on success or empty string on failure This value cannot be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getManufacturerCode
open fun getManufacturerCode(): String?
Returns the Manufacturer Code from the MEID. Return null if Manufacturer Code is not available.
Requires the PackageManager#FEATURE_TELEPHONY_CDMA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CDMA . |
getManufacturerCode
open fun getManufacturerCode(slotIndex: Int): String?
Returns the Manufacturer Code from the MEID. Return null if Manufacturer Code is not available.
Requires the PackageManager#FEATURE_TELEPHONY_CDMA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
slotIndex |
Int: of which Type Allocation Code is returned |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CDMA . |
getMaximumCallComposerPictureSize
open static fun getMaximumCallComposerPictureSize(): Long
Indicates the maximum size of the call composure picture. Pictures sent via uploadCallComposerPicture(java.io.InputStream,java.lang.String,java.util.concurrent.Executor,android.os.OutcomeReceiver)
or uploadCallComposerPicture(java.nio.file.Path,java.lang.String,java.util.concurrent.Executor,android.os.OutcomeReceiver)
must not exceed this size, or an error will be returned via the callback in those methods.
Value is a non-negative number of bytes.
Return | |
---|---|
Long |
Maximum file size in bytes. Value is a non-negative number of bytes. |
getMeid
open fun getMeid(): String!
Returns the MEID (Mobile Equipment Identifier). Return null if MEID is not available.
Starting with API level 29, persistent device identifiers are guarded behind additional restrictions, and apps are recommended to use resettable identifiers (see Best practices for unique identifiers). This method can be invoked if one of the following requirements is met:
- If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
- If the calling app is the device owner of a fully-managed device, a profile owner of an organization-owned device, or their delegates (see
android.app.admin.DevicePolicyManager#getEnrollmentSpecificId()
). - If the calling app has carrier privileges (see
hasCarrierPrivileges
) on any active subscription. - If the calling app is the default SMS role holder (see
android.app.role.RoleManager#isRoleHeld(java.lang.String)
).
If the calling app does not meet one of these requirements then this method will behave as follows:
- If the calling app's target SDK is API level 28 or lower and the app has the READ_PHONE_STATE permission then null is returned.
- If the calling app's target SDK is API level 28 or lower and the app does not have the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or higher, then a SecurityException is thrown.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the
PackageManager#FEATURE_TELEPHONY_CDMA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CDMA . |
getMeid
open fun getMeid(slotIndex: Int): String!
Returns the MEID (Mobile Equipment Identifier). Return null if MEID is not available.
Starting with API level 29, persistent device identifiers are guarded behind additional restrictions, and apps are recommended to use resettable identifiers (see Best practices for unique identifiers). This method can be invoked if one of the following requirements is met:
- If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
- If the calling app is the device owner of a fully-managed device, a profile owner of an organization-owned device, or their delegates (see
android.app.admin.DevicePolicyManager#getEnrollmentSpecificId()
). - If the calling app has carrier privileges (see
hasCarrierPrivileges
) on any active subscription. - If the calling app is the default SMS role holder (see
android.app.role.RoleManager#isRoleHeld(java.lang.String)
).
If the calling app does not meet one of these requirements then this method will behave as follows:
- If the calling app's target SDK is API level 28 or lower and the app has the READ_PHONE_STATE permission then null is returned.
- If the calling app's target SDK is API level 28 or lower and the app does not have the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or higher, then a SecurityException is thrown.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the
PackageManager#FEATURE_TELEPHONY_CDMA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
slotIndex |
Int: of which MEID is returned |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CDMA . |
getMmsUAProfUrl
open fun getMmsUAProfUrl(): String!
Returns the MMS user agent profile URL.
Requires the PackageManager#FEATURE_TELEPHONY_MESSAGING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_MESSAGING . |
getMmsUserAgent
open fun getMmsUserAgent(): String!
Returns the MMS user agent.
Requires the PackageManager#FEATURE_TELEPHONY_MESSAGING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_MESSAGING . |
getNai
open fun getNai(): String!
Returns the Network Access Identifier (NAI). Return null if NAI is not available.
Starting with API level 29, persistent device identifiers are guarded behind additional restrictions, and apps are recommended to use resettable identifiers (see Best practices for unique identifiers). This method can be invoked if one of the following requirements is met:
- If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
- If the calling app is the device owner of a fully-managed device, a profile owner of an organization-owned device, or their delegates (see
android.app.admin.DevicePolicyManager#getEnrollmentSpecificId()
). - If the calling app has carrier privileges (see
hasCarrierPrivileges
). - If the calling app is the default SMS role holder (see
android.app.role.RoleManager#isRoleHeld(java.lang.String)
).
If the calling app does not meet one of these requirements then this method will behave as follows:
- If the calling app's target SDK is API level 28 or lower and the app has the READ_PHONE_STATE permission then null is returned.
- If the calling app's target SDK is API level 28 or lower and the app does not have the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or higher, then a SecurityException is thrown.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the
PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getNetworkCountryIso
open fun getNetworkCountryIso(): String!
Returns the ISO-3166-1 alpha-2 country code equivalent of the MCC (Mobile Country Code) of the current registered operator or the cell nearby, if available. Note: Result may be unreliable on CDMA networks (use getPhoneType()
to determine if on a CDMA network).
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
String! |
the lowercase 2 character ISO-3166-1 alpha-2 country code, or empty string if not available. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getNetworkCountryIso
open fun getNetworkCountryIso(slotIndex: Int): String
Returns the ISO-3166-1 alpha-2 country code equivalent of the MCC (Mobile Country Code) of the current registered operator or the cell nearby, if available. This is same as getNetworkCountryIso()
but allowing specifying the SIM slot index. This is used for accessing network country info from the SIM slot that does not have SIM inserted. Note: Result may be unreliable on CDMA networks (use getPhoneType()
to determine if on a CDMA network).
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
slotIndex |
Int: the SIM slot index to get network country ISO. |
Return | |
---|---|
String |
the lowercase 2 character ISO-3166-1 alpha-2 country code, or empty string if not available. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
when the slotIndex is invalid. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getNetworkOperator
open fun getNetworkOperator(): String!
Returns the numeric name (MCC+MNC) of current registered operator.
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).
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
getNetworkOperatorName
open fun getNetworkOperatorName(): String!
Returns the alphabetic name of current registered operator.
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).
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
getNetworkSelectionMode
open fun getNetworkSelectionMode(): Int
Get the network selection mode.
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
Requires Permission: READ_PRECISE_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE or android.Manifest.permission#READ_PRECISE_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Int |
the network selection mode. Value is android.telephony.TelephonyManager#NETWORK_SELECTION_MODE_UNKNOWN , android.telephony.TelephonyManager#NETWORK_SELECTION_MODE_AUTO , or android.telephony.TelephonyManager#NETWORK_SELECTION_MODE_MANUAL |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getNetworkSlicingConfiguration
open fun getNetworkSlicingConfiguration(
executor: Executor,
callback: OutcomeReceiver<NetworkSlicingConfig!, TelephonyManager.NetworkSlicingException!>
): Unit
Request to get the current slicing configuration including URSP rules and NSSAIs (configured, allowed and rejected). This method can be invoked if one of the following requirements is met:
- If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
- If the calling app has carrier privileges (see
hasCarrierPrivileges
).
Requires the
TelephonyManager#CAPABILITY_SLICING_CONFIG_SUPPORTED
feature which can be detected using TelephonyManager.isRadioInterfaceCapabilitySupported(String)
. Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Parameters | |
---|---|
executor |
Executor: the executor on which callback will be invoked. This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
callback |
OutcomeReceiver<NetworkSlicingConfig!, TelephonyManager.NetworkSlicingException!>: a callback to receive the current slicing configuration. This value cannot be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getNetworkSpecifier
open fun getNetworkSpecifier(): String!
Returns the network specifier of the subscription ID pinned to the TelephonyManager. The network specifier is used by android.net.NetworkRequest.Builder#setNetworkSpecifier(String)
to create a that connects through the subscription.
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
getNetworkType
open fungetNetworkType(): Int
Deprecated: use getDataNetworkType()
Return the current data network type.
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getPhoneAccountHandle
open fun getPhoneAccountHandle(): PhoneAccountHandle?
Determines the PhoneAccountHandle
associated with this TelephonyManager.
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
Requires Permission android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE or that the calling app has carrier privileges (see hasCarrierPrivileges
)
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
PhoneAccountHandle? |
The PhoneAccountHandle associated with the TelphonyManager, or null if there is no associated PhoneAccountHandle ; this can happen if the subscription is data-only or an opportunistic subscription. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
getPhoneCount
open fungetPhoneCount(): Int
Deprecated: Use getActiveModemCount
instead.
Returns the number of phones available. Returns 0 if none of voice, sms, data is not supported Returns 1 for Single standby mode (Single SIM functionality). Returns 2 for Dual standby mode (Dual SIM functionality). Returns 3 for Tri standby mode (Tri SIM functionality).
getPhoneType
open fun getPhoneType(): Int
Returns a constant indicating the device phone type. This indicates the type of radio used to transmit voice/data calls.
Requires the PackageManager#FEATURE_TELEPHONY
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY . |
getPreferredOpportunisticDataSubscription
open fun getPreferredOpportunisticDataSubscription(): Int
Get preferred opportunistic data subscription Id
Requires that the calling app has carrier privileges (see hasCarrierPrivileges
), or has either READ_PRIVILEGED_PHONE_STATE or READ_PHONE_STATE
permission.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE or android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Int |
subId preferred opportunistic subscription id or SubscriptionManager.DEFAULT_SUBSCRIPTION_ID if there are no preferred subscription id |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
getPrimaryImei
open fun getPrimaryImei(): String
Returns the primary IMEI (International Mobile Equipment Identity) of the device as mentioned in GSMA TS.37. getImei(int)
returns the IMEI that belongs to the selected slotID whereas this API getPrimaryImei()
returns primary IMEI of the device. A single SIM device with only one IMEI will be set by default as primary IMEI. A multi-SIM device with multiple IMEIs will have one of the IMEIs set as primary as mentioned in GSMA TS37_2.2_REQ_8.
Requires one of the following permissions
- If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
- If the calling app is the device owner of a fully-managed device, a profile owner of an organization-owned device, or their delegates (see
android.app.admin.DevicePolicyManager#getEnrollmentSpecificId()
). - If the calling app has carrier privileges (see
hasCarrierPrivileges
) on any active subscription. - If the calling app is the default SMS role holder (see
android.app.role.RoleManager#isRoleHeld(java.lang.String)
). - If the calling app has been granted the
Manifest.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER
permission.
Return | |
---|---|
String |
Primary IMEI of type string This value cannot be null . |
Exceptions | |
---|---|
java.lang.SecurityException |
if the caller does not have the required permission/privileges |
getServiceState
open fun getServiceState(): ServiceState?
Returns the current ServiceState
information.
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
If you want continuous updates of service state info, register a TelephonyCallback
that implements TelephonyCallback.ServiceStateListener
through #registerTelephonyCallback.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
) and android.Manifest.permission#ACCESS_COARSE_LOCATION
. May return null
when the subscription is inactive or when there was an error communicating with the phone process.
Requires android.Manifest.permission#READ_PHONE_STATE
and android.Manifest.permission#ACCESS_COARSE_LOCATION
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getServiceState
open fun getServiceState(includeLocationData: Int): ServiceState?
Returns the current ServiceState
information.
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
If you want continuous updates of service state info, register a TelephonyCallback
that implements TelephonyCallback.ServiceStateListener
through #registerTelephonyCallback. There's another way to renounce permissions with a custom context AttributionSource.Builder#setRenouncedPermissions(Set<String>)
but only for system apps. To avoid confusion, calling this method supersede renouncing permissions with a custom context.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
) and android.Manifest.permission#ACCESS_COARSE_LOCATION
.
Requires android.Manifest.permission#READ_PHONE_STATE
and android.Manifest.permission#ACCESS_COARSE_LOCATION
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
includeLocationData |
Int: Specifies if the caller would like to receive location related information. May return null when the subscription is inactive or when there was an error communicating with the phone process. Value is android.telephony.TelephonyManager#INCLUDE_LOCATION_DATA_NONE , android.telephony.TelephonyManager#INCLUDE_LOCATION_DATA_COARSE , or android.telephony.TelephonyManager#INCLUDE_LOCATION_DATA_FINE |
Return | |
---|---|
ServiceState? |
This value may be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getSignalStrength
open fun getSignalStrength(): SignalStrength?
Get the most recently available signal strength information. Get the most recent SignalStrength information reported by the modem. Due to power saving this information may not always be current.
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
SignalStrength? |
the most recent cached signal strength info from the modem This value may be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getSimCarrierId
open fun getSimCarrierId(): Int
Returns carrier id of the current subscription.
To recognize a carrier (including MVNO) as a first-class identity, Android assigns each carrier with a canonical integer a.k.a. carrier id. The carrier ID is an Android platform-wide identifier for a carrier. AOSP maintains carrier ID assignments in here
Apps which have carrier-specific configurations or business logic can use the carrier id as an Android platform-wide identifier for carriers.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Int |
Carrier id of the current subscription. Return UNKNOWN_CARRIER_ID if the subscription is unavailable or the carrier cannot be identified. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getSimCarrierIdName
open fun getSimCarrierIdName(): CharSequence?
Returns carrier id name of the current subscription.
Carrier id name is a user-facing name of carrier id returned by getSimCarrierId()
, usually the brand name of the subsidiary (e.g. T-Mobile). Each carrier could configure multiple SPN
but should have a single carrier name. Carrier name is not a canonical identity, use getSimCarrierId()
instead.
The returned carrier name is unlocalized.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
CharSequence? |
Carrier name of the current subscription. Return null if the subscription is unavailable or the carrier cannot be identified. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getSimCountryIso
open fun getSimCountryIso(): String!
Returns the ISO-3166-1 alpha-2 country code equivalent for the SIM provider's country code.
The ISO-3166-1 alpha-2 country code is provided in lowercase 2 character format.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
String! |
the lowercase 2 character ISO-3166-1 alpha-2 country code, or empty string is not available. |
getSimOperator
open fun getSimOperator(): String!
Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. 5 or 6 decimal digits.
Availability: SIM state must be SIM_STATE_READY
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
See Also
getSimOperatorName
open fun getSimOperatorName(): String!
Returns the Service Provider Name (SPN).
Availability: SIM state must be SIM_STATE_READY
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
See Also
getSimSerialNumber
open fun getSimSerialNumber(): String!
Returns the serial number of the SIM, if applicable. Return null if it is unavailable.
Starting with API level 29, persistent device identifiers are guarded behind additional restrictions, and apps are recommended to use resettable identifiers (see Best practices for unique identifiers). This method can be invoked if one of the following requirements is met:
- If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
- If the calling app is the device owner of a fully-managed device, a profile owner of an organization-owned device, or their delegates (see
android.app.admin.DevicePolicyManager#getEnrollmentSpecificId()
). - If the calling app has carrier privileges (see
hasCarrierPrivileges
). - If the calling app is the default SMS role holder (see
android.app.role.RoleManager#isRoleHeld(java.lang.String)
).
If the calling app does not meet one of these requirements then this method will behave as follows:
- If the calling app's target SDK is API level 28 or lower and the app has the READ_PHONE_STATE permission then null is returned.
- If the calling app's target SDK is API level 28 or lower and the app does not have the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or higher, then a SecurityException is thrown.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the
PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getSimSpecificCarrierId
open fun getSimSpecificCarrierId(): Int
Returns fine-grained carrier ID of the current subscription. A specific carrier ID can represent the fact that a carrier may be in effect an aggregation of other carriers (ie in an MVNO type scenario) where each of these specific carriers which are used to make up the actual carrier service may have different carrier configurations. A specific carrier ID could also be used, for example, in a scenario where a carrier requires different carrier configuration for different service offering such as a prepaid plan. the specific carrier ID would be used for configuration purposes, but apps wishing to know about the carrier itself should use the regular carrier ID returned by getSimCarrierId()
. e.g, Tracfone SIMs could return different specific carrier ID based on IMSI from current subscription while carrier ID remains the same.
For carriers without fine-grained specific carrier ids, return getSimCarrierId()
Specific carrier ids are defined in the same way as carrier id here except each with a "parent" id linking to its top-level carrier id.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Int |
Returns fine-grained carrier id of the current subscription. Return UNKNOWN_CARRIER_ID if the subscription is unavailable or the carrier cannot be identified. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getSimSpecificCarrierIdName
open fun getSimSpecificCarrierIdName(): CharSequence?
Similar like getSimCarrierIdName()
, returns user-facing name of the specific carrier id returned by getSimSpecificCarrierId()
. The specific carrier ID would be used for configuration purposes, but apps wishing to know about the carrier itself should use the regular carrier ID returned by getSimCarrierIdName()
.
The returned name is unlocalized.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
CharSequence? |
user-facing name of the subscription specific carrier id. Return null if the subscription is unavailable or the carrier cannot be identified. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getSimState
open fun getSimState(): Int
Returns a constant indicating the state of the default SIM card.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Int |
Value is android.telephony.TelephonyManager#SIM_STATE_UNKNOWN , android.telephony.TelephonyManager#SIM_STATE_ABSENT , android.telephony.TelephonyManager#SIM_STATE_PIN_REQUIRED , android.telephony.TelephonyManager#SIM_STATE_PUK_REQUIRED , android.telephony.TelephonyManager#SIM_STATE_NETWORK_LOCKED , android.telephony.TelephonyManager#SIM_STATE_READY , android.telephony.TelephonyManager#SIM_STATE_NOT_READY , android.telephony.TelephonyManager#SIM_STATE_PERM_DISABLED , android.telephony.TelephonyManager#SIM_STATE_CARD_IO_ERROR , android.telephony.TelephonyManager#SIM_STATE_CARD_RESTRICTED , android.telephony.TelephonyManager.SIM_STATE_LOADED, or android.telephony.TelephonyManager.SIM_STATE_PRESENT |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getSimState
open fun getSimState(slotIndex: Int): Int
Returns a constant indicating the state of the device SIM card in a logical slot.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
slotIndex |
Int: logical slot index |
Return | |
---|---|
Int |
Value is android.telephony.TelephonyManager#SIM_STATE_UNKNOWN , android.telephony.TelephonyManager#SIM_STATE_ABSENT , android.telephony.TelephonyManager#SIM_STATE_PIN_REQUIRED , android.telephony.TelephonyManager#SIM_STATE_PUK_REQUIRED , android.telephony.TelephonyManager#SIM_STATE_NETWORK_LOCKED , android.telephony.TelephonyManager#SIM_STATE_READY , android.telephony.TelephonyManager#SIM_STATE_NOT_READY , android.telephony.TelephonyManager#SIM_STATE_PERM_DISABLED , android.telephony.TelephonyManager#SIM_STATE_CARD_IO_ERROR , android.telephony.TelephonyManager#SIM_STATE_CARD_RESTRICTED , android.telephony.TelephonyManager.SIM_STATE_LOADED, or android.telephony.TelephonyManager.SIM_STATE_PRESENT |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getSubscriberId
open fun getSubscriberId(): String!
Returns the unique subscriber ID, for example, the IMSI for a GSM phone. Return null if it is unavailable.
Starting with API level 29, persistent device identifiers are guarded behind additional restrictions, and apps are recommended to use resettable identifiers (see Best practices for unique identifiers). This method can be invoked if one of the following requirements is met:
- If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
- If the calling app is the device owner of a fully-managed device, a profile owner of an organization-owned device, or their delegates (see
android.app.admin.DevicePolicyManager#getEnrollmentSpecificId()
). - If the calling app has carrier privileges (see
hasCarrierPrivileges
). - If the calling app is the default SMS role holder (see
android.app.role.RoleManager#isRoleHeld(java.lang.String)
). - If the calling app has been granted the
Manifest.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER
permission.
If the calling app does not meet one of these requirements then this method will behave as follows:
- If the calling app's target SDK is API level 28 or lower and the app has the READ_PHONE_STATE permission then null is returned.
- If the calling app's target SDK is API level 28 or lower and the app does not have the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or higher, then a SecurityException is thrown.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the
PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getSubscriptionId
open fun getSubscriptionId(): Int
Return an appropriate subscription ID for any situation. If this object has been created with createForSubscriptionId
, then the provided subscription ID is returned. Otherwise, the default subscription ID will be returned.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
getSubscriptionId
open fun getSubscriptionId(phoneAccountHandle: PhoneAccountHandle): Int
Returns the subscription ID for the given phone account handle.
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
phoneAccountHandle |
PhoneAccountHandle: the phone account handle for outgoing calls This value cannot be null . |
Return | |
---|---|
Int |
subscription ID for the given phone account handle; or SubscriptionManager.INVALID_SUBSCRIPTION_ID if not available; or throw a SecurityException if the caller doesn't have the permission. |
getSupportedModemCount
open fun getSupportedModemCount(): Int
Return how many logical modem can be potentially active simultaneously, in terms of hardware capability. It might return different value from getActiveModemCount
. For example, for a dual-SIM capable device operating in single SIM mode (only one logical modem is turned on), getActiveModemCount
returns 1 while this API returns 2.
getSupportedRadioAccessFamily
open fun getSupportedRadioAccessFamily(): Long
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.SecurityException |
if the caller does not have the required permission |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
getTypeAllocationCode
open fun getTypeAllocationCode(): String?
Returns the Type Allocation Code from the IMEI. Return null if Type Allocation Code is not available.
getTypeAllocationCode
open fun getTypeAllocationCode(slotIndex: Int): String?
Returns the Type Allocation Code from the IMEI. Return null if Type Allocation Code is not available.
Parameters | |
---|---|
slotIndex |
Int: of which Type Allocation Code is returned |
getUiccCardsInfo
open fun getUiccCardsInfo(): MutableList<UiccCardInfo!>
Gets information about currently inserted UICCs and eUICCs.
Requires that the calling app has carrier privileges (see hasCarrierPrivileges
).
If the caller has carrier priviliges on any active subscription, then they have permission to get simple information like the card ID (UiccCardInfo.getCardId()
), whether the card is an eUICC (UiccCardInfo.isEuicc()
), and the physical slot index where the card is inserted (UiccCardInfo.getPhysicalSlotIndex()
.
To get private information such as the EID (UiccCardInfo.getEid()
) or ICCID (UiccCardInfo.getIccId()
), the caller must have carrier priviliges on that specific UICC or eUICC card.
See UiccCardInfo
for more details on the kind of information available.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
MutableList<UiccCardInfo!> |
a list of UiccCardInfo objects, representing information on the currently inserted UICCs and eUICCs. Each UiccCardInfo in the list will have private information filtered out if the caller does not have adequate permissions for that card. This value cannot be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
getVisualVoicemailPackageName
open fun getVisualVoicemailPackageName(): String?
Returns the package responsible of processing visual voicemail for the subscription ID pinned to the TelephonyManager. Returns null
when there is no package responsible for processing visual voicemail for the subscription.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
getVoiceMailAlphaTag
open fun getVoiceMailAlphaTag(): String!
Retrieves the alphabetic identifier associated with the voice mail number.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
getVoiceMailNumber
open fun getVoiceMailNumber(): String!
Returns the voice mail number. Return null if it is unavailable.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
getVoiceNetworkType
open fun getVoiceNetworkType(): Int
Returns the NETWORK_TYPE_xxxx for voice
Requires Permission: READ_PHONE_STATE
or READ_BASIC_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
or android.Manifest.permission#READ_BASIC_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
getVoicemailRingtoneUri
open fun getVoicemailRingtoneUri(accountHandle: PhoneAccountHandle!): Uri?
Returns the URI for the per-account voicemail ringtone set in Phone settings.
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
accountHandle |
PhoneAccountHandle!: The handle for the PhoneAccount for which to retrieve the voicemail ringtone. |
Return | |
---|---|
Uri? |
The URI for the ringtone to play when receiving a voicemail from a specific PhoneAccount. May be null if no ringtone is set. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
hasCarrierPrivileges
open fun hasCarrierPrivileges(): Boolean
Has the calling application been granted carrier privileges by the carrier. If any of the packages in the calling UID has carrier privileges, the call will return true. This access is granted by the owner of the UICC card and does not depend on the registered carrier. Note that this API applies to both physical and embedded subscriptions and is a superset of the checks done in SubscriptionManager#canManageSubscription.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if the app has carrier privileges. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
hasIccCard
open fun hasIccCard(): Boolean
This API is used to check if there is an ICC card present in the device. An ICC card is a smart card that contains a subscriber identity module (SIM) and is used to identify and authenticate users to a mobile network. Note: In case of embedded SIM there is an ICC card always present irrespective of whether an active SIM profile is present or not so this API would always return true.
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if a ICC card is present. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
iccCloseLogicalChannel
open fun iccCloseLogicalChannel(channel: Int): Boolean
Closes a previously opened logical channel to the ICC card. Input parameters equivalent to TS 27.007 AT+CCHC command. It is strongly recommended that callers of this API should firstly create new TelephonyManager instance by calling TelephonyManager.createForSubscriptionId(int)
. Failure to do so can result in unpredictable and detrimental behavior like callers can end up talking to the wrong SIM card.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
channel |
Int: is the channel id to be closed as returned by a successful iccOpenLogicalChannel. |
Return | |
---|---|
Boolean |
true if the channel was closed successfully. |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if input parameters are wrong. e.g., invalid channel |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
iccExchangeSimIO
open fun iccExchangeSimIO(
fileID: Int,
command: Int,
p1: Int,
p2: Int,
p3: Int,
filePath: String!
): ByteArray!
Returns the response APDU for a command APDU sent through SIM_IO.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
fileID |
Int: |
command |
Int: |
p1 |
Int: P1 value of the APDU command. |
p2 |
Int: P2 value of the APDU command. |
p3 |
Int: P3 value of the APDU command. |
filePath |
String!: |
Return | |
---|---|
ByteArray! |
The APDU response. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
iccOpenLogicalChannel
open funiccOpenLogicalChannel(AID: String!): IccOpenLogicalChannelResponse!
Deprecated: Replaced by iccOpenLogicalChannel(java.lang.String,int)
Opens a logical channel to the ICC card. Input parameters equivalent to TS 27.007 AT+CCHO command.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
AID |
String!: Application id. See ETSI 102.221 and 101.220. |
Return | |
---|---|
IccOpenLogicalChannelResponse! |
an IccOpenLogicalChannelResponse object. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
iccOpenLogicalChannel
open fun iccOpenLogicalChannel(
AID: String!,
p2: Int
): IccOpenLogicalChannelResponse!
Opens a logical channel to the ICC card. This operation wraps two APDU instructions:
- MANAGE CHANNEL to open a logical channel
- SELECT the given
AID
using the givenp2
TelephonyManager.createForSubscriptionId(int)
. Failure to do so can result in unpredictable and detrimental behavior like callers can end up talking to the wrong SIM card.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
AID |
String!: Application id. See ETSI 102.221 and 101.220. |
p2 |
Int: P2 parameter (described in ISO 7816-4). |
Return | |
---|---|
IccOpenLogicalChannelResponse! |
an IccOpenLogicalChannelResponse object. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
iccTransmitApduBasicChannel
open fun iccTransmitApduBasicChannel(
cla: Int,
instruction: Int,
p1: Int,
p2: Int,
p3: Int,
data: String!
): String!
Transmit an APDU to the ICC card over the basic channel. Input parameters equivalent to TS 27.007 AT+CSIM command.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
cla |
Int: Class of the APDU command. |
instruction |
Int: Instruction of the APDU command. |
p1 |
Int: P1 value of the APDU command. |
p2 |
Int: P2 value of the APDU command. |
p3 |
Int: P3 value of the APDU command. If p3 is negative a 4 byte APDU is sent to the SIM. |
data |
String!: Data to be sent with the APDU. |
Return | |
---|---|
String! |
The APDU response from the ICC card with the status appended at the end. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
iccTransmitApduLogicalChannel
open fun iccTransmitApduLogicalChannel(
channel: Int,
cla: Int,
instruction: Int,
p1: Int,
p2: Int,
p3: Int,
data: String!
): String!
Transmit an APDU to the ICC card over a logical channel. Input parameters equivalent to TS 27.007 AT+CGLA command. It is strongly recommended that callers of this API should firstly create a new TelephonyManager instance by calling TelephonyManager.createForSubscriptionId(int)
. Failure to do so can result in unpredictable and detrimental behavior like callers can end up talking to the wrong SIM card.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
channel |
Int: is the channel id to be closed as returned by a successful iccOpenLogicalChannel. |
cla |
Int: Class of the APDU command. |
instruction |
Int: Instruction of the APDU command. |
p1 |
Int: P1 value of the APDU command. |
p2 |
Int: P2 value of the APDU command. |
p3 |
Int: P3 value of the APDU command. If p3 is negative a 4 byte APDU is sent to the SIM. |
data |
String!: Data to be sent with the APDU. |
Return | |
---|---|
String! |
The APDU response from the ICC card with the status appended at the end. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
isConcurrentVoiceAndDataSupported
open fun isConcurrentVoiceAndDataSupported(): Boolean
Whether the device is currently on a technology (e.g. UMTS or LTE) which can support voice and data simultaneously. This can change based on location or network condition.
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if simultaneous voice and data supported, and false otherwise. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
isDataCapable
open fun isDataCapable(): Boolean
Return | |
---|---|
Boolean |
true if the current device is "data capable" over a radio on the device.
"Data capable" means that this device supports packet-switched data connections over the telephony network. |
isDataConnectionAllowed
open fun isDataConnectionAllowed(): Boolean
Checks whether cellular data connection is allowed in the device.
Whether cellular data connection is allowed considers all factors below:
- User turned on data setting
isDataEnabled
. - Carrier allows data to be on.
- Network policy.
- And possibly others.
Requires
android.Manifest.permission#ACCESS_NETWORK_STATE
or android.Manifest.permission#READ_PHONE_STATE
or android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE or android.Manifest.permission#READ_BASIC_PHONE_STATE
Requires the
PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if the overall data connection is allowed; false if not. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
isDataEnabled
open fun isDataEnabled(): Boolean
Returns whether mobile data is enabled or not per user setting. There are other factors that could disable mobile data, but they are not considered here. If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultDataSubscriptionId()
Requires one of the following permissions: android.Manifest.permission#ACCESS_NETWORK_STATE
, android.Manifest.permission#MODIFY_PHONE_STATE
, or READ_BASIC_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Note that this does not take into account any data restrictions that may be present on the calling app. Such restrictions may be inspected with ConnectivityManager.getRestrictBackgroundStatus
.
Requires android.Manifest.permission#ACCESS_NETWORK_STATE
or android.Manifest.permission#MODIFY_PHONE_STATE
or android.Manifest.permission#READ_PHONE_STATE
or android.Manifest.permission#READ_BASIC_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if mobile data is enabled. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
isDataEnabledForReason
open fun isDataEnabledForReason(reason: Int): Boolean
Return whether data is enabled for certain reason . If isDataEnabledForReason
returns false, it means in data enablement for a specific reason is turned off. If any of the reason is off, then it will result in bypassing user preference and result in data to be turned off. Call isDataConnectionAllowed
in order to know whether data connection is allowed on the device.
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultDataSubscriptionId()
Requires android.Manifest.permission#ACCESS_NETWORK_STATE
or android.Manifest.permission#READ_PHONE_STATE
or android.Manifest.permission#MODIFY_PHONE_STATE
or android.Manifest.permission#READ_BASIC_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
reason |
Int: the reason the data enable change is taking place Value is android.telephony.TelephonyManager#DATA_ENABLED_REASON_USER , android.telephony.TelephonyManager#DATA_ENABLED_REASON_POLICY , android.telephony.TelephonyManager#DATA_ENABLED_REASON_CARRIER , or android.telephony.TelephonyManager#DATA_ENABLED_REASON_THERMAL |
Return | |
---|---|
Boolean |
whether data is enabled for a reason.
Requires Permission: The calling app has carrier privileges (see |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if the Telephony process is not currently available. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
isDataRoamingEnabled
open fun isDataRoamingEnabled(): Boolean
Returns whether mobile data roaming is enabled on the subscription.
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultDataSubscriptionId()
Requires one of the following permissions: android.Manifest.permission#ACCESS_NETWORK_STATE
, android.Manifest.permission#READ_PHONE_STATE
or READ_BASIC_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#ACCESS_NETWORK_STATE
or android.Manifest.permission#READ_PHONE_STATE
or android.Manifest.permission#READ_BASIC_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if the data roaming is enabled on the subscription, otherwise return |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . false . |
isDeviceSmsCapable
open fun isDeviceSmsCapable(): Boolean
Return | |
---|---|
Boolean |
true if the current device supports SMS service.
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. Starting from Android 15, SMS capability may also be overridden by carriers for a given subscription on an SMS capable device. To check if a subscription is "SMS capable", call method |
isDeviceVoiceCapable
open fun isDeviceVoiceCapable(): Boolean
Return | |
---|---|
Boolean |
true if the current device is "voice capable".
"Voice capable" means that this device supports circuit-switched or IMS packet 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. Starting from Android 15, voice capability may also be overridden by carrier for a given subscription on a voice capable device. To check if a subscription is "voice capable", call method |
isEmergencyNumber
open fun isEmergencyNumber(number: String): Boolean
Identifies if the supplied phone number is an emergency number that matches a known emergency number based on current locale, SIM card(s), Android database, modem, network, or defaults.
This method assumes that only dialable phone numbers are passed in; non-dialable numbers are not considered emergency numbers. A dialable phone number consists only of characters/digits identified by PhoneNumberUtils.isDialable(char)
.
The subscriptions which the identification would be based on, are all the active subscriptions, no matter which subscription could be used to create TelephonyManager.
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
number |
String: - the number to look up This value cannot be null . |
Return | |
---|---|
Boolean |
true if the given number is an emergency number based on current locale, SIM card(s), Android database, modem, network or defaults; false otherwise. |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if the Telephony process is not currently available. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
isHearingAidCompatibilitySupported
open fun isHearingAidCompatibilitySupported(): Boolean
Whether the phone supports hearing aid compatibility.
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if the device supports hearing aid compatibility, and false otherwise. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
isManualNetworkSelectionAllowed
open fun isManualNetworkSelectionAllowed(): Boolean
Checks if manual network selection is allowed.
Requires Permission: READ_PRECISE_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
)
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
.
Requires android.Manifest.permission#READ_PRECISE_PHONE_STATE
or android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if manual network selection is allowed, otherwise return false . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
isModemEnabledForSlot
open fun isModemEnabledForSlot(slotIndex: Int): Boolean
Indicates whether or not there is a modem stack enabled for the given SIM slot.
Requires Permission: READ_PHONE_STATE
, READ_PRIVILEGED_PHONE_STATE or that the calling app has carrier privileges (see hasCarrierPrivileges()
).
Requires android.Manifest.permission#READ_PHONE_STATE
or android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
slotIndex |
Int: which slot it's checking. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY . |
isMultiSimSupported
open fun isMultiSimSupported(): Int
Returns if the usage of multiple SIM cards at the same time to register on the network (e.g. Dual Standby or Dual Active) is supported by the device and by the carrier.
Requires Permission: READ_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#READ_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Int |
MULTISIM_ALLOWED if the device supports multiple SIMs. MULTISIM_NOT_SUPPORTED_BY_HARDWARE if the device does not support multiple SIMs. MULTISIM_NOT_SUPPORTED_BY_CARRIER in the device supports multiple SIMs, but the functionality is restricted by the carrier. Value is android.telephony.TelephonyManager#MULTISIM_ALLOWED , android.telephony.TelephonyManager#MULTISIM_NOT_SUPPORTED_BY_HARDWARE , or android.telephony.TelephonyManager#MULTISIM_NOT_SUPPORTED_BY_CARRIER |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
isNetworkRoaming
open fun isNetworkRoaming(): Boolean
Returns true if the device is considered roaming on the current network, for GSM purposes.
Availability: Only when user registered to a network.
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
isPremiumCapabilityAvailableForPurchase
open fun isPremiumCapabilityAvailableForPurchase(capability: Int): Boolean
Check whether the given premium capability is available for purchase from the carrier. If this is true
, the capability can be purchased from the carrier using purchasePremiumCapability(int,java.util.concurrent.Executor,java.util.function.Consumer)
.
Requires android.Manifest.permission#READ_BASIC_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
capability |
Int: The premium capability to check. Value is android.telephony.TelephonyManager#PREMIUM_CAPABILITY_PRIORITIZE_LATENCY |
Return | |
---|---|
Boolean |
Whether the given premium capability is available to purchase. |
Exceptions | |
---|---|
java.lang.SecurityException |
if the caller does not hold permission READ_BASIC_PHONE_STATE. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
isRadioInterfaceCapabilitySupported
open fun isRadioInterfaceCapabilitySupported(capability: String): Boolean
Whether the device supports a given capability on the radio interface. If the capability is not in the set of radio interface capabilities, false is returned.
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
capability |
String: the name of the capability to check for This value cannot be null . Value is android.telephony.TelephonyManager#CAPABILITY_SLICING_CONFIG_SUPPORTED , or android.telephony.TelephonyManager.CAPABILITY_SIM_PHONEBOOK_IN_MODEM |
Return | |
---|---|
Boolean |
the availability of the capability |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
isRttSupported
open fun isRttSupported(): Boolean
Determines whether the device currently supports RTT (Real-time text). Based both on carrier support for the feature and device firmware support.
Requires the PackageManager#FEATURE_TELEPHONY_IMS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if the device and carrier both support RTT, false otherwise. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_IMS . |
isSmsCapable
open funisSmsCapable(): Boolean
Deprecated: Replaced by isDeviceSmsCapable()
. Starting from Android 15, SMS capability may also be overridden by carriers for a given subscription. For SMS capable device (when isDeviceSmsCapable
return true
), caller should check for subscription-level SMS capability as well. See isDeviceSmsCapable
for details.
Return | |
---|---|
Boolean |
true if the current device supports sms service.
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. |
isTtyModeSupported
open funisTtyModeSupported(): Boolean
Deprecated: Use TelecomManager.isTtySupported()
instead Whether the phone supports TTY mode.
Return | |
---|---|
Boolean |
true if the device supports TTY mode, and false otherwise. |
isVoiceCapable
open funisVoiceCapable(): Boolean
Deprecated: Replaced by isDeviceVoiceCapable()
. Starting from Android 15, voice capability may also be overridden by carriers for a given subscription. For voice capable device (when isDeviceVoiceCapable
return true
), caller should check for subscription-level voice capability as well. See isDeviceVoiceCapable
for details.
Return | |
---|---|
Boolean |
true if the current device is "voice capable".
"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. |
isVoicemailVibrationEnabled
open fun isVoicemailVibrationEnabled(accountHandle: PhoneAccountHandle!): Boolean
Returns whether vibration is set for voicemail notification in Phone settings.
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
accountHandle |
PhoneAccountHandle!: The handle for the PhoneAccount for which to retrieve the voicemail vibration setting. |
Return | |
---|---|
Boolean |
true if the vibration is set for this PhoneAccount, false otherwise. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
isWorldPhone
open fun isWorldPhone(): Boolean
Whether the device is a world phone.
Requires the PackageManager#FEATURE_TELEPHONY
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true if the device is a world phone, and false otherwise. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY . |
listen
open funlisten(
listener: PhoneStateListener!,
events: Int
): Unit
Deprecated: Use registerTelephonyCallback(java.util.concurrent.Executor,android.telephony.TelephonyCallback)
.
Registers a listener object to receive notification of changes in specified telephony states.
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 un-register a listener, pass the listener object and set the events argument to LISTEN_NONE
(0). If this TelephonyManager object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
. To listen events for multiple subIds, pass a separate listener object to each TelephonyManager object created with createForSubscriptionId
. Note: if you call this method while in the middle of a binder transaction, you must call android.os.Binder#clearCallingIdentity()
before calling this method. A SecurityException
will be thrown otherwise. This API should be used sparingly -- large numbers of listeners will cause system instability. If a process has registered too many listeners without unregistering them, it may encounter an IllegalStateException
when trying to register more listeners.
Parameters | |
---|---|
listener |
PhoneStateListener!: The PhoneStateListener object to register (or unregister) |
events |
Int: The telephony state(s) of interest to the listener, as a bitwise-OR combination of PhoneStateListener LISTEN_ flags. |
purchasePremiumCapability
open fun purchasePremiumCapability(
capability: Int,
executor: Executor,
callback: Consumer<Int!>
): Unit
Purchase the given premium capability from the carrier. This requires user action to purchase the boost from the carrier. If this returns PURCHASE_PREMIUM_CAPABILITY_RESULT_SUCCESS
or PURCHASE_PREMIUM_CAPABILITY_RESULT_ALREADY_PURCHASED
, applications can request the premium capability via android.net.ConnectivityManager#requestNetwork.
Requires android.Manifest.permission#READ_BASIC_PHONE_STATE
and android.Manifest.permission#INTERNET
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.SecurityException |
if the caller does not hold permissions READ_BASIC_PHONE_STATE or INTERNET. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
rebootModem
open fun rebootModem(): Unit
Generate a radio modem reset. Used for device configuration by some carriers.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.IllegalStateException |
if the Telephony process is not currently available. |
java.lang.RuntimeException |
|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
registerTelephonyCallback
open fun registerTelephonyCallback(
includeLocationData: Int,
executor: Executor,
callback: TelephonyCallback
): Unit
Registers a callback object to receive notification of changes in specified telephony states.
To register a callback, pass a TelephonyCallback
which implements interfaces of events. For example, FakeServiceStateCallback extends TelephonyCallback
implements TelephonyCallback.ServiceStateListener
. At registration, and when a specified telephony state changes, the telephony manager invokes the appropriate callback method on the callback object and passes the current (updated) values.
If this TelephonyManager object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
. To register events for multiple subIds, pass a separate callback object to each TelephonyManager object created with createForSubscriptionId
. Note: if you call this method while in the middle of a binder transaction, you must call android.os.Binder#clearCallingIdentity()
before calling this method. A SecurityException
will be thrown otherwise. This API should be used sparingly -- large numbers of callbacks will cause system instability. If a process has registered too many callbacks without unregistering them, it may encounter an IllegalStateException
when trying to register more callbacks.
There's another way to renounce permissions with a custom context AttributionSource.Builder#setRenouncedPermissions(Set<String>)
but only for system apps. To avoid confusion, calling this method supersede renouncing permissions with a custom context.
Parameters | |
---|---|
includeLocationData |
Int: Specifies if the caller would like to receive location related information. Value is android.telephony.TelephonyManager#INCLUDE_LOCATION_DATA_NONE , android.telephony.TelephonyManager#INCLUDE_LOCATION_DATA_COARSE , or android.telephony.TelephonyManager#INCLUDE_LOCATION_DATA_FINE |
executor |
Executor: The executor of where the callback will execute. This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
callback |
TelephonyCallback: The TelephonyCallback object to register. The caller should hold a reference to the callback. The framework only holds a weak reference. This value cannot be null . |
registerTelephonyCallback
open fun registerTelephonyCallback(
executor: Executor,
callback: TelephonyCallback
): Unit
Registers a callback object to receive notification of changes in specified telephony states.
To register a callback, pass a TelephonyCallback
which implements interfaces of events. For example, FakeServiceStateCallback extends TelephonyCallback
implements TelephonyCallback.ServiceStateListener
. At registration, and when a specified telephony state changes, the telephony manager invokes the appropriate callback method on the callback object and passes the current (updated) values.
Note: Be aware of the permission requirements stated on the TelephonyCallback
listeners you implement. Your application must be granted these permissions in order to register a TelephonyCallback
which requires them; a SecurityException
will be thrown if you do not hold the required permissions for all TelephonyCallback
listeners you implement.
If this TelephonyManager object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
. To register events for multiple subIds, pass a separate callback object to each TelephonyManager object created with createForSubscriptionId
. Note: if you call this method while in the middle of a binder transaction, you must call android.os.Binder#clearCallingIdentity()
before calling this method. A SecurityException
will be thrown otherwise. This API should be used sparingly -- large numbers of callbacks will cause system instability. If a process has registered too many callbacks without unregistering them, it may encounter an IllegalStateException
when trying to register more callbacks.
Parameters | |
---|---|
executor |
Executor: The executor of where the callback will execute. This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
callback |
TelephonyCallback: The TelephonyCallback object to register. The caller should hold a reference to the callback. The framework only holds a weak reference. This value cannot be null . |
requestCellInfoUpdate
open fun requestCellInfoUpdate(
executor: Executor,
callback: TelephonyManager.CellInfoCallback
): Unit
Requests all available cell information from the current subscription for observed camped/registered, serving, and neighboring cells.
Any available results from this request will be provided by calls to onCellInfoChanged()
for each active subscription.
This method returns valid data for devices with FEATURE_TELEPHONY
. On devices that do not implement this feature, the behavior is not reliable.
Requires android.Manifest.permission#ACCESS_FINE_LOCATION
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
executor |
Executor: the executor on which callback will be invoked. This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
callback |
TelephonyManager.CellInfoCallback: a callback to receive CellInfo. This value cannot be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
requestNetworkScan
open fun requestNetworkScan(
request: NetworkScanRequest!,
executor: Executor!,
callback: TelephonyScanManager.NetworkScanCallback!
): NetworkScan!
Request a network scan. This method is asynchronous, so the network scan results will be returned by callback. The returned NetworkScan will contain a callback method which can be used to stop the scan.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
) and android.Manifest.permission#ACCESS_FINE_LOCATION
. If the system-wide location switch is off, apps may still call this API, with the following constraints:
- The app must hold the
android.permission.NETWORK_SCAN
permission. - The app must not supply any specific bands or channels to scan.
- The app must only specify MCC/MNC pairs that are associated to a SIM in the device.
- Returned results will have no meaningful info other than signal strength and MCC/MNC info.
Requires
android.Manifest.permission#MODIFY_PHONE_STATE
and android.Manifest.permission#ACCESS_FINE_LOCATION
Requires the
PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
request |
NetworkScanRequest!: Contains all the RAT with bands/channels that need to be scanned. |
executor |
Executor!: The executor through which the callback should be invoked. Since the scan request may trigger multiple callbacks and they must be invoked in the same order as they are received by the platform, the user should provide an executor which executes tasks one at a time in serial order. |
callback |
TelephonyScanManager.NetworkScanCallback!: Returns network scan results or errors. |
Return | |
---|---|
NetworkScan! |
A NetworkScan obj which contains a callback which can be used to stop the scan. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
requestNetworkScan
open fun requestNetworkScan(
includeLocationData: Int,
request: NetworkScanRequest,
executor: Executor,
callback: TelephonyScanManager.NetworkScanCallback
): NetworkScan?
Request a network scan. This method is asynchronous, so the network scan results will be returned by callback. The returned NetworkScan will contain a callback method which can be used to stop the scan.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
) and android.Manifest.permission#ACCESS_FINE_LOCATION
if includeLocationData is set to INCLUDE_LOCATION_DATA_FINE
. If the system-wide location switch is off, apps may still call this API, with the following constraints:
- The app must hold the
android.permission.NETWORK_SCAN
permission. - The app must not supply any specific bands or channels to scan.
- The app must only specify MCC/MNC pairs that are associated to a SIM in the device.
- Returned results will have no meaningful info other than signal strength and MCC/MNC info.
Requires
android.Manifest.permission#MODIFY_PHONE_STATE
Requires the
PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
includeLocationData |
Int: Specifies if the caller would like to receive location related information. If this parameter is set to INCLUDE_LOCATION_DATA_FINE then the application will be checked for android.Manifest.permission#ACCESS_FINE_LOCATION permission and available location related information received during network scan will be sent to the caller. Value is android.telephony.TelephonyManager#INCLUDE_LOCATION_DATA_NONE , android.telephony.TelephonyManager#INCLUDE_LOCATION_DATA_COARSE , or android.telephony.TelephonyManager#INCLUDE_LOCATION_DATA_FINE |
request |
NetworkScanRequest: Contains all the RAT with bands/channels that need to be scanned. This value cannot be null . |
executor |
Executor: The executor through which the callback should be invoked. Since the scan request may trigger multiple callbacks and they must be invoked in the same order as they are received by the platform, the user should provide an executor which executes tasks one at a time in serial order. This value cannot be null . |
callback |
TelephonyScanManager.NetworkScanCallback: Returns network scan results or errors. This value cannot be null . |
Return | |
---|---|
NetworkScan? |
A NetworkScan obj which contains a callback which can be used to stop the scan. This value may be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
sendDialerSpecialCode
open fun sendDialerSpecialCode(inputCode: String!): Unit
Send the special dialer code. The IPC caller must be the current default dialer or have carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
inputCode |
String!: The special dialer code to send |
Exceptions | |
---|---|
java.lang.SecurityException |
if the caller does not have carrier privileges or is not the current default dialer |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
sendEnvelopeWithStatus
open fun sendEnvelopeWithStatus(content: String!): String!
Send ENVELOPE to the SIM and return the response.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
content |
String!: String containing SAT/USAT response in hexadecimal format starting with command tag. See TS 102 223 for details. |
Return | |
---|---|
String! |
The APDU response from the ICC card in hexadecimal format with the last 4 bytes being the status word. If the command fails, returns an empty string. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
sendUssdRequest
open fun sendUssdRequest(
ussdRequest: String!,
callback: TelephonyManager.UssdResponseCallback!,
handler: Handler!
): Unit
Sends an Unstructured Supplementary Service Data (USSD) request to the mobile network and informs the caller of the response via the supplied callback
.
Carriers define USSD codes which can be sent by the user to request information such as the user's current data balance or minutes balance.
Requires permission: android.Manifest.permission#CALL_PHONE
Requires android.Manifest.permission#CALL_PHONE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
ussdRequest |
String!: the USSD command to be executed. |
callback |
TelephonyManager.UssdResponseCallback!: called by the framework to inform the caller of the result of executing the USSD request (see UssdResponseCallback ). |
handler |
Handler!: the Handler to run the request on. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
sendVisualVoicemailSms
open fun sendVisualVoicemailSms(
number: String!,
port: Int,
text: String!,
sentIntent: PendingIntent!
): Unit
Send a visual voicemail SMS. The caller must be the current default dialer. A VisualVoicemailService
uses this method to send a command via SMS to the carrier's visual voicemail server. Some examples for carriers using the OMTP standard include activating and deactivating visual voicemail, or requesting the current visual voicemail provisioning status. See the OMTP Visual Voicemail specification for more information on the format of these SMS messages.
Requires Permission: SEND_SMS
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
number |
String!: The destination number. |
port |
Int: The destination port for data SMS, or 0 for text SMS. |
text |
String!: The message content. For data sms, it will be encoded as a UTF-8 byte stream. |
sentIntent |
PendingIntent!: The sent intent passed to the SmsManager |
Exceptions | |
---|---|
java.lang.SecurityException |
if the caller is not the current default dialer |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
setAllowedNetworkTypesForReason
open fun setAllowedNetworkTypesForReason(
reason: Int,
allowedNetworkTypes: Long
): Unit
Set the allowed network types of the device and provide the reason triggering the allowed network change.
Requires permission: android.Manifest.permission#MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
). This can be called for following reasons:
- Allowed network types control by USER
TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER
- Allowed network types control by carrier
ALLOWED_NETWORK_TYPES_REASON_CARRIER
Requires
android.Manifest.permission#MODIFY_PHONE_STATE
Requires the TelephonyManager#CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK feature which can be detected using
TelephonyManager.isRadioInterfaceCapabilitySupported(String)
.
Exceptions | |
---|---|
java.lang.IllegalStateException |
if the Telephony process is not currently available. |
java.lang.IllegalArgumentException |
if invalid AllowedNetworkTypesReason is passed. |
java.lang.SecurityException |
if the caller does not have the required privileges or if the |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
setCallComposerStatus
open fun setCallComposerStatus(status: Int): Unit
Set the user-set status for enriched calling with call composer.
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
status |
Int: user-set status for enriched calling with call composer.
If this object has been created with |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if requested state is invalid. |
java.lang.SecurityException |
if the caller does not have the permission. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
setDataEnabled
open funsetDataEnabled(enable: Boolean): Unit
Deprecated: use setDataEnabledForReason with reason DATA_ENABLED_REASON_USER instead.
Turns mobile data on or off. If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultDataSubscriptionId()
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
enable |
Boolean: Whether to enable mobile data. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
setDataEnabledForReason
open fun setDataEnabledForReason(
reason: Int,
enabled: Boolean
): Unit
Control of data connection and provide the reason triggering the data connection control. This can be called for following reasons
- data limit is passed
DATA_ENABLED_REASON_POLICY
- data disabled by carrier
DATA_ENABLED_REASON_CARRIER
- data disabled by user
DATA_ENABLED_REASON_USER
- data disabled due to thermal
DATA_ENABLED_REASON_THERMAL
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultDataSubscriptionId()
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
reason |
Int: the reason the data enable change is taking place Value is android.telephony.TelephonyManager#DATA_ENABLED_REASON_USER , android.telephony.TelephonyManager#DATA_ENABLED_REASON_POLICY , android.telephony.TelephonyManager#DATA_ENABLED_REASON_CARRIER , or android.telephony.TelephonyManager#DATA_ENABLED_REASON_THERMAL |
enabled |
Boolean: True if enabling the data, otherwise disabling.
Requires Permission: The calling app has carrier privileges (see |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if the Telephony process is not currently available. |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
setForbiddenPlmns
open fun setForbiddenPlmns(fplmns: MutableList<String!>): Int
Replace the contents of the forbidden PLMN SIM file with the provided values. Passing an empty list will clear the contents of the EFfplmn file. If the provided list is shorter than the size of EFfplmn, then the list will be padded up to the file size with 'FFFFFF'. (required by 3GPP TS 31.102 spec 4.2.16) If the list is longer than the size of EFfplmn, then the file will be written from the beginning of the list up to the file size.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
fplmns |
MutableList<String!>: a list of PLMNs to be forbidden. This value cannot be null . |
Return | |
---|---|
Int |
number of PLMNs that were successfully written to the SIM FPLMN list. This may be less than the number of PLMNs passed in where the SIM file does not have enough room for all of the values passed in. Return -1 in the event of an unexpected failure |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
setLine1NumberForDisplay
open funsetLine1NumberForDisplay(
alphaTag: String!,
number: String!
): Boolean
Deprecated: use SubscriptionManager.setCarrierPhoneNumber(int, String)
instead.
Set the line 1 phone number string and its alphatag for the current ICCID for display purpose only, for example, displayed in Phone Status. It won't change the actual MSISDN/MDN. To unset alphatag or number, pass in a null value.
Requires that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
alphaTag |
String!: alpha-tagging of the dailing nubmer |
number |
String!: The dialing number |
Return | |
---|---|
Boolean |
true if the operation was executed correctly. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
setNetworkSelectionModeAutomatic
open fun setNetworkSelectionModeAutomatic(): Unit
Sets the network selection mode to automatic.
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
setNetworkSelectionModeManual
open fun setNetworkSelectionModeManual(
operatorNumeric: String!,
persistSelection: Boolean
): Boolean
Ask the radio to connect to the input network and change selection mode to manual.
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
operatorNumeric |
String!: the PLMN ID of the network to select. |
persistSelection |
Boolean: whether the selection will persist until reboot. If true, only allows attaching to the selected PLMN until reboot; otherwise, attach to the chosen PLMN and resume normal network selection next time. |
Return | |
---|---|
Boolean |
true on success; false on any failure. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
setNetworkSelectionModeManual
open fun setNetworkSelectionModeManual(
operatorNumeric: String,
persistSelection: Boolean,
ran: Int
): Boolean
Ask the radio to connect to the input network and change selection mode to manual.
If this object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
operatorNumeric |
String: the PLMN ID of the network to select. This value cannot be null . |
persistSelection |
Boolean: whether the selection will persist until reboot. If true, only allows attaching to the selected PLMN until reboot; otherwise, attach to the chosen PLMN and resume normal network selection next time. |
ran |
Int: the initial suggested radio access network type. If registration fails, the RAN is not available after, the RAN is not within the network types specified by the preferred network types, or the value is AccessNetworkConstants.AccessNetworkType.UNKNOWN , modem will select the next best RAN for network registration. Value is android.telephony.AccessNetworkConstants.AccessNetworkType#UNKNOWN , android.telephony.AccessNetworkConstants.AccessNetworkType#GERAN , android.telephony.AccessNetworkConstants.AccessNetworkType#UTRAN , android.telephony.AccessNetworkConstants.AccessNetworkType#EUTRAN , android.telephony.AccessNetworkConstants.AccessNetworkType#CDMA2000 , android.telephony.AccessNetworkConstants.AccessNetworkType#IWLAN , or android.telephony.AccessNetworkConstants.AccessNetworkType#NGRAN |
Return | |
---|---|
Boolean |
true on success; false on any failure. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
setOperatorBrandOverride
open fun setOperatorBrandOverride(brand: String!): Boolean
Override the branding for the current ICCID. Once set, whenever the SIM is present in the device, the service provider name (SPN) and the operator name will both be replaced by the brand value input. To unset the value, the same function should be called with a null brand value.
Requires that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
brand |
String!: The brand name to display/set. |
Return | |
---|---|
Boolean |
true if the operation was executed correctly. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
setPreferredNetworkTypeToGlobal
open fun setPreferredNetworkTypeToGlobal(): Boolean
Set the preferred network type to global mode which includes NR, LTE, CDMA, EvDo and GSM/WCDMA.
Requires that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Return | |
---|---|
Boolean |
true on success; false on any failure. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
setPreferredOpportunisticDataSubscription
open fun setPreferredOpportunisticDataSubscription(
subId: Int,
needValidation: Boolean,
executor: Executor?,
callback: Consumer<Int!>?
): Unit
Set preferred opportunistic data subscription id. Switch internet data to preferred opportunistic data subscription id. This api can result in lose of internet connectivity for short period of time while internet data is handed over.
Requires that the calling app has carrier privileges on both primary and secondary subscriptions (see hasCarrierPrivileges
), or has permission MODIFY_PHONE_STATE
.
Requires the PackageManager#FEATURE_TELEPHONY_DATA
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
subId |
Int: which opportunistic subscription SubscriptionManager.getOpportunisticSubscriptions is preferred for cellular data. Pass SubscriptionManager.DEFAULT_SUBSCRIPTION_ID to unset the preference |
needValidation |
Boolean: whether validation is needed before switch happens. |
executor |
Executor?: The executor of where the callback will execute. This value may be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
callback |
Consumer<Int!>?: Callback will be triggered once it succeeds or failed. See the SET_OPPORTUNISTIC_SUB_* constants for more details. Pass null if don't care about the result. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_DATA . |
setSignalStrengthUpdateRequest
open fun setSignalStrengthUpdateRequest(request: SignalStrengthUpdateRequest): Unit
Set a SignalStrengthUpdateRequest
to receive notification when signal quality measurements breach the specified thresholds. To be notified, set the signal strength update request and then register TelephonyCallback
that implements TelephonyCallback.SignalStrengthsListener
through #registerTelephonyCallback. The notification will arrive through TelephonyCallback.SignalStrengthsListener.onSignalStrengthsChanged(SignalStrength)
. To stop receiving the notification over the specified thresholds, pass the same SignalStrengthUpdateRequest
object to clearSignalStrengthUpdateRequest(android.telephony.SignalStrengthUpdateRequest)
. System will clean up the SignalStrengthUpdateRequest
if the caller process died without calling clearSignalStrengthUpdateRequest(android.telephony.SignalStrengthUpdateRequest)
. If this TelephonyManager object has been created with createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager.getDefaultSubscriptionId()
. To request for multiple subIds, pass a request object to each TelephonyManager object created with createForSubscriptionId
.
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see TelephonyManager.hasCarrierPrivileges
). Note that the thresholds in the request will be used on a best-effort basis; the system may modify requests to multiplex various request sources or to optimize power consumption. The caller should not expect to be notified with the exactly the same thresholds.
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
request |
SignalStrengthUpdateRequest: the SignalStrengthUpdateRequest to be set into the System This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if a new request is set with same subId from the same caller |
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
setVisualVoicemailSmsFilterSettings
open fun setVisualVoicemailSmsFilterSettings(settings: VisualVoicemailSmsFilterSettings!): Unit
Set the visual voicemail SMS filter settings for the subscription ID pinned to the TelephonyManager. When the filter is enabled, android.telephony.VisualVoicemailService#onSmsReceived(android.telephony.VisualVoicemailService.VisualVoicemailTask,android.telephony.VisualVoicemailSms)
will be called when a SMS matching the settings is received. Caller must be the default dialer, system dialer, or carrier visual voicemail app.
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
settings |
VisualVoicemailSmsFilterSettings!: The settings for the filter, or null to disable the filter. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
setVoiceMailNumber
open fun setVoiceMailNumber(
alphaTag: String!,
number: String!
): Boolean
Sets the voice mail number.
Requires that the calling app has carrier privileges (see hasCarrierPrivileges
).
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
alphaTag |
String!: The alpha tag to display. |
number |
String!: The voicemail number. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
setVoicemailRingtoneUri
open funsetVoicemailRingtoneUri(
phoneAccountHandle: PhoneAccountHandle!,
uri: Uri!
): Unit
Deprecated: Use android.provider.Settings#ACTION_CHANNEL_NOTIFICATION_SETTINGS
instead.
Sets the per-account voicemail ringtone.
Requires that the calling app is the default dialer, or has carrier privileges (see hasCarrierPrivileges
, or has permission MODIFY_PHONE_STATE
.
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
phoneAccountHandle |
PhoneAccountHandle!: The handle for the PhoneAccount for which to set the voicemail ringtone. |
uri |
Uri!: The URI for the ringtone to play when receiving a voicemail from a specific PhoneAccount. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
setVoicemailVibrationEnabled
open funsetVoicemailVibrationEnabled(
phoneAccountHandle: PhoneAccountHandle!,
enabled: Boolean
): Unit
Deprecated: Use android.provider.Settings#ACTION_CHANNEL_NOTIFICATION_SETTINGS
instead.
Sets the per-account preference whether vibration is enabled for voicemail notifications.
Requires that the calling app is the default dialer, or has carrier privileges (see hasCarrierPrivileges
, or has permission MODIFY_PHONE_STATE
.
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
phoneAccountHandle |
PhoneAccountHandle!: The handle for the PhoneAccount for which to set the voicemail vibration setting. |
enabled |
Boolean: Whether to enable or disable vibration for voicemail notifications from a specific PhoneAccount. |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
switchMultiSimConfig
open fun switchMultiSimConfig(numOfSims: Int): Unit
Switch configs to enable multi-sim or switch back to single-sim
Requires Permission: MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see hasCarrierPrivileges
). Note: with only carrier privileges, it is not allowed to switch from multi-sim to single-sim
Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
numOfSims |
Int: number of live SIMs we want to switch to |
Exceptions | |
---|---|
android.os.RemoteException |
|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION . |
unregisterTelephonyCallback
open fun unregisterTelephonyCallback(callback: TelephonyCallback): Unit
Unregister an existing TelephonyCallback
.
Parameters | |
---|---|
callback |
TelephonyCallback: The TelephonyCallback object to unregister. This value cannot be null . |
updateAvailableNetworks
open fun updateAvailableNetworks(
availableNetworks: MutableList<AvailableNetworkInfo!>,
executor: Executor?,
callback: Consumer<Int!>?
): Unit
Update availability of a list of networks in the current location. This api should be called to inform OpportunisticNetwork Service about the availability of a network at the current location. This information will be used by OpportunisticNetwork service to enable modem stack and to attach to the network. If an empty list is passed, it is assumed that no network is available and will result in disabling the modem stack to save power. This api do not switch internet data once network attach is completed. Use TelephonyManager.setPreferredOpportunisticDataSubscription
to switch internet data after network attach is complete. Requires that the calling app has carrier privileges on both primary and secondary subscriptions (see hasCarrierPrivileges
), or has permission MODIFY_PHONE_STATE
.
Requires the PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS . |
uploadCallComposerPicture
open fun uploadCallComposerPicture(
pictureToUpload: InputStream,
contentType: String,
executor: Executor,
callback: OutcomeReceiver<ParcelUuid!, TelephonyManager.CallComposerException!>
): Unit
Uploads a picture to the carrier network for use with call composer. This method allows a dialer app to upload a picture to the carrier network that can then later be attached to an outgoing call. In order to attach the picture to a call, use the ParcelUuid
returned from callback
upon successful upload as the value to TelecomManager.EXTRA_OUTGOING_PICTURE
. This functionality is only available to the app filling the RoleManager.ROLE_DIALER
role on the device. This functionality is only available when CarrierConfigManager.KEY_SUPPORTS_CALL_COMPOSER_BOOL
is set to true
in the bundle returned from getCarrierConfig()
.
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
pictureToUpload |
InputStream: An InputStream that supplies the bytes representing the picture to upload. The client bears responsibility for closing this stream after callback is called with success or failure. Additionally, if the stream supplies more bytes than the return value of getMaximumCallComposerPictureSize() , the upload will be aborted and the callback will be called with an exception containing CallComposerException.ERROR_FILE_TOO_LARGE . This value cannot be null . |
contentType |
String: The MIME type of the picture you're uploading (e.g. image/jpeg). The list of acceptable content types can be found at 3GPP TS 26.141 sections 4.2 and 4.3. This value cannot be null . |
executor |
Executor: The Executor on which the pictureToUpload stream will be read, as well as on which the callback will be called. Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. This value cannot be null . |
callback |
OutcomeReceiver<ParcelUuid!, TelephonyManager.CallComposerException!>: A callback called when the upload operation terminates, either in success or in error. This value cannot be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
uploadCallComposerPicture
open fun uploadCallComposerPicture(
pictureToUpload: Path,
contentType: String,
executor: Executor,
callback: OutcomeReceiver<ParcelUuid!, TelephonyManager.CallComposerException!>
): Unit
Uploads a picture to the carrier network for use with call composer.
Requires the PackageManager#FEATURE_TELEPHONY_CALLING
feature which can be detected using PackageManager.hasSystemFeature(String)
.
Parameters | |
---|---|
pictureToUpload |
Path: Path to a local file containing the picture to upload. This value cannot be null . |
contentType |
String: The MIME type of the picture you're uploading (e.g. image/jpeg) This value cannot be null . |
executor |
Executor: The Executor on which the pictureToUpload file will be read from disk, as well as on which callback will be called. Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. This value cannot be null . |
callback |
OutcomeReceiver<ParcelUuid!, TelephonyManager.CallComposerException!>: A callback called when the upload operation terminates, either in success or in error. This value cannot be null . |
Exceptions | |
---|---|
java.lang.UnsupportedOperationException |
If the device does not have PackageManager.FEATURE_TELEPHONY_CALLING . |
Properties
EXTRA_STATE_IDLE
static val EXTRA_STATE_IDLE: String!
Value used with EXTRA_STATE
corresponding to CALL_STATE_IDLE
.
EXTRA_STATE_OFFHOOK
static val EXTRA_STATE_OFFHOOK: String!
Value used with EXTRA_STATE
corresponding to CALL_STATE_OFFHOOK
.
EXTRA_STATE_RINGING
static val EXTRA_STATE_RINGING: String!
Value used with EXTRA_STATE
corresponding to CALL_STATE_RINGING
.