FileDocCategorySizeDatePackage
ITelephony.javaAPI DocAndroid 5.1 API145984Sat Mar 14 05:48:12 GMT 2015com.android.internal.telephony

ITelephony

public interface ITelephony implements android.os.IInterface
Interface used to interact with the phone. Mostly this is used by the TelephonyManager class. A few places are still using this directly. Please clean them up if possible and use TelephonyManager instead. {@hide}

Fields Summary
Constructors Summary
Methods Summary
public voidanswerRingingCall()
Answer the currently-ringing call. If there's already a current active call, that call will be automatically put on hold. If both lines are currently in use, the current active call will be ended. TODO: provide a flag to let the caller specify what policy to use if both lines are in use. (The current behavior is hardwired to "answer incoming, end ongoing", which is how the CALL button is specced to behave.) TODO: this should be a oneway call (especially since it's called directly from the key queue thread).

public voidanswerRingingCallForSubscriber(int subId)
Answer the currently-ringing call on particular subId . If there's already a current active call, that call will be automatically put on hold. If both lines are currently in use, the current active call will be ended. TODO: provide a flag to let the caller specify what policy to use if both lines are in use. (The current behavior is hardwired to "answer incoming, end ongoing", which is how the CALL button is specced to behave.) TODO: this should be a oneway call (especially since it's called directly from the key queue thread).

public voidcall(java.lang.String callingPackage, java.lang.String number)
Place a call to the specified number.

param
number the number to be called.

public intcheckCarrierPrivilegesForPackage(java.lang.String pkgname)
Similar to above, but check for pkg whose name is pkgname.

public voiddial(java.lang.String number)
Dial a number. This doesn't place the call. It displays the Dialer screen.

param
number the number to be dialed. If null, this would display the Dialer screen with no number pre-filled.

public booleandisableDataConnectivity()
Disallow mobile data connections.

public voiddisableLocationUpdates()
Disable location update notifications.

public voiddisableLocationUpdatesForSubscriber(int subId)
Disable location update notifications.

param
subId user preferred subId.

public booleanenableDataConnectivity()
Allow mobile data connections.

public voidenableLocationUpdates()
Enable location update notifications.

public voidenableLocationUpdatesForSubscriber(int subId)
Enable location update notifications.

param
subId user preferred subId.

public voidenableVideoCalling(boolean enable)
Enables or disables video calling.

param
enable Whether to enable video calling.

public booleanendCall()
End call if there is a call in progress, otherwise does nothing.

return
whether it hung up

public booleanendCallForSubscriber(int subId)
End call on particular subId or go to the Home screen

param
subId user preferred subId.
return
whether it hung up

public intgetActivePhoneType()
Returns the current active phone type as integer. Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE

public intgetActivePhoneTypeForSubscriber(int subId)
Returns the current active phone type as integer for particular subId. Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE

param
subId user preferred subId.

public java.util.ListgetAllCellInfo()
Returns the all observed cell information of the device.

public intgetCalculatedPreferredNetworkType()

public intgetCallState()

public intgetCallStateForSubscriber(int subId)
Returns the call state for a subId.

public java.util.ListgetCarrierPackageNamesForIntent(android.content.Intent intent)
Returns the package name of the carrier apps that should handle the input intent.

param
packageManager PackageManager for getting receivers.
param
intent Intent that will be sent.
return
list of carrier app package names that can handle the intent. Returns null if there is an error and an empty list if there are no matching packages.

public intgetCarrierPrivilegeStatus()
Has the calling application been granted special 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. TODO: Add a link to documentation.

return
carrier privilege status defined in TelephonyManager.

public intgetCdmaEriIconIndex()
Returns the CDMA ERI icon index to display

public intgetCdmaEriIconIndexForSubscriber(int subId)
Returns the CDMA ERI icon index to display on particular subId.

param
subId user preferred subId.

public intgetCdmaEriIconMode()
Returns the CDMA ERI icon mode, 0 - ON 1 - FLASHING

public intgetCdmaEriIconModeForSubscriber(int subId)
Returns the CDMA ERI icon mode on particular subId, 0 - ON 1 - FLASHING

param
subId user preferred subId.

public java.lang.StringgetCdmaEriText()
Returns the CDMA ERI text,

public java.lang.StringgetCdmaEriTextForSubscriber(int subId)
Returns the CDMA ERI text for particular subId,

param
subId user preferred subId.

public java.lang.StringgetCdmaMdn(int subId)
Return MDN string for CDMA phone.

param
subId user preferred subId.

public java.lang.StringgetCdmaMin(int subId)
Return MIN string for CDMA phone.

param
subId user preferred subId.

public android.os.BundlegetCellLocation()

public intgetDataActivity()

public booleangetDataEnabled(int subId)
Get the user enabled state of Mobile Data.

return
true on enabled

public intgetDataNetworkType()
Returns the network type for data transmission

public intgetDataNetworkTypeForSubscriber(int subId)
Returns the data network type of a subId

param
subId user preferred subId. Returns the network type

public intgetDataState()

public intgetDefaultSim()
get default sim

return
sim id

public java.lang.StringgetDeviceId()
Returns the unique device ID of phone, for example, the IMEI for GSM and the MEID for CDMA phones. Return null if device ID is not available.

Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}

public java.lang.StringgetLine1AlphaTagForDisplay(int subId)
Returns the displayed alphatag of the dialing number if it was set previously via {@link #setLine1NumberForDisplay}. Otherwise returns null.

param
subId whose alphatag associated with line 1 is returned.
return
the displayed alphatag of the dialing number if set, or null if not set.

public java.lang.StringgetLine1NumberForDisplay(int subId)
Returns the displayed dialing number string if it was set previously via {@link #setLine1NumberForDisplay}. Otherwise returns null.

param
subId whose dialing number for line 1 is returned.
return
the displayed dialing number if set, or null if not set.

public intgetLteOnCdmaMode()
Return if the current radio is LTE on CDMA. This is a tri-state return value as for a period of time the mode may be unknown.

return
{@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE} or {@link PHone#LTE_ON_CDMA_TRUE}

public intgetLteOnCdmaModeForSubscriber(int subId)
Return if the current radio is LTE on CDMA. This is a tri-state return value as for a period of time the mode may be unknown.

return
{@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE} or {@link PHone#LTE_ON_CDMA_TRUE}

public java.lang.String[]getMergedSubscriberIds()

public java.util.ListgetNeighboringCellInfo(java.lang.String callingPkg)
Returns the neighboring cell information of the device.

public intgetNetworkType()
Returns the network type for data transmission

public intgetNetworkTypeForSubscriber(int subId)
Returns the network type of a subId.

param
subId user preferred subId. Returns the network type

public java.lang.String[]getPcscfAddress(java.lang.String apnType)
Get P-CSCF address from PCO after data connection is established or modified.

param
apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN

public intgetPreferredNetworkType()

public intgetRadioAccessFamily(int phoneId)
Get phone radio type and access technology.

param
phoneId which phone you want to get
return
phone radio type and access technology

public intgetTetherApnRequired()
Check TETHER_DUN_REQUIRED and TETHER_DUN_APN settings, net.tethering.noprovisioning SystemProperty, and config_tether_apndata to decide whether DUN APN is required for tethering.

return
0: Not required. 1: required. 2: Not set.

public intgetVoiceMessageCount()
Returns the unread count of voicemails

public intgetVoiceMessageCountForSubscriber(int subId)
Returns the unread count of voicemails for a subId.

param
subId user preferred subId. Returns the unread count of voicemails

public intgetVoiceNetworkType()
Returns the network type for voice

public intgetVoiceNetworkTypeForSubscriber(int subId)
Returns the voice network type of a subId

param
subId user preferred subId. Returns the network type

public booleanhandlePinMmi(java.lang.String dialString)
Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated without SEND (so dial is not appropriate).

param
dialString the MMI command to be executed.
return
true if MMI command is executed.

public booleanhandlePinMmiForSubscriber(int subId, java.lang.String dialString)
Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated without SEND (so dial is not appropriate) for a particular subId.

param
dialString the MMI command to be executed.
param
subId user preferred subId.
return
true if MMI command is executed.

public booleanhasIccCard()
Return true if an ICC card is present

public booleanhasIccCardUsingSlotId(int slotId)
Return true if an ICC card is present for a subId.

param
slotId user preferred slotId. Return true if an ICC card is present

public booleaniccCloseLogicalChannel(int channel)
Closes a previously opened logical channel to the ICC card. Input parameters equivalent to TS 27.007 AT+CCHC command.

param
channel is the channel id to be closed as retruned by a successful iccOpenLogicalChannel.
return
true if the channel was closed successfully.

public byte[]iccExchangeSimIO(int fileID, int command, int p1, int p2, int p3, java.lang.String filePath)
Returns the response APDU for a command APDU sent through SIM_IO.

param
fileID
param
command
param
p1 P1 value of the APDU command.
param
p2 P2 value of the APDU command.
param
p3 P3 value of the APDU command.
param
filePath
return
The APDU response.

public android.telephony.IccOpenLogicalChannelResponseiccOpenLogicalChannel(java.lang.String AID)
Opens a logical channel to the ICC card. Input parameters equivalent to TS 27.007 AT+CCHO command.

param
AID Application id. See ETSI 102.221 and 101.220.
return
an IccOpenLogicalChannelResponse object.

public java.lang.StringiccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, java.lang.String data)
Transmit an APDU to the ICC card over the basic channel. Input parameters equivalent to TS 27.007 AT+CSIM command.

param
cla Class of the APDU command.
param
instruction Instruction of the APDU command.
param
p1 P1 value of the APDU command.
param
p2 P2 value of the APDU command.
param
p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU is sent to the SIM.
param
data Data to be sent with the APDU.
return
The APDU response from the ICC card with the status appended at the end.

public java.lang.StringiccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, java.lang.String data)
Transmit an APDU to the ICC card over a logical channel. Input parameters equivalent to TS 27.007 AT+CGLA command.

param
channel is the channel id to be closed as retruned by a successful iccOpenLogicalChannel.
param
cla Class of the APDU command.
param
instruction Instruction of the APDU command.
param
p1 P1 value of the APDU command.
param
p2 P2 value of the APDU command.
param
p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU is sent to the SIM.
param
data Data to be sent with the APDU.
return
The APDU response from the ICC card with the status appended at the end.

public intinvokeOemRilRequestRaw(byte[] oemReq, byte[] oemResp)
Returns the result and response from RIL for oem request

param
oemReq the data is sent to ril.
param
oemResp the respose data from RIL.
return
negative value request was not handled or get error 0 request was handled succesfully, but no response data positive value success, data length of response

public booleanisDataConnectivityPossible()
Report whether data connectivity is possible.

public booleanisIdle()
Check if the phone is idle.

return
true if the phone state is IDLE.

public booleanisIdleForSubscriber(int subId)
Check if the phone is idle on a particular subId.

param
subId user preferred subId.
return
true if the phone state is IDLE.

public booleanisImsRegistered()
Get IMS Registration Status

public booleanisOffhook()
Check if we are in either an active or holding call

return
true if the phone state is OFFHOOK.

public booleanisOffhookForSubscriber(int subId)
Check if a particular subId has an active or holding call

param
subId user preferred subId.
return
true if the phone state is OFFHOOK.

public booleanisRadioOn()
Check to see if the radio is on or not.

return
returns true if the radio is on.

public booleanisRadioOnForSubscriber(int subId)
Check to see if the radio is on or not on particular subId.

param
subId user preferred subId.
return
returns true if the radio is on.

public booleanisRinging()
Check if an incoming phone call is ringing or call waiting.

return
true if the phone state is RINGING.

public booleanisRingingForSubscriber(int subId)
Check if an incoming phone call is ringing or call waiting on a particular subId.

param
subId user preferred subId.
return
true if the phone state is RINGING.

public booleanisSimPinEnabled()
Check if the SIM pin lock is enabled.

return
true if the SIM pin lock is enabled.

public booleanisVideoCallingEnabled()
Whether video calling has been enabled by the user.

return
{@code True} if the user has enabled video calling, {@code false} otherwise.

public booleanneedMobileRadioShutdown()
Check if any mobile Radios need to be shutdown.

return
true is any mobile radio needs to be shutdown

public booleanneedsOtaServiceProvisioning()
Returns true if OTA service provisioning needs to run. Only relevant on some technologies, others will always return false.

public java.lang.StringnvReadItem(int itemID)
Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}. Used for device configuration by some CDMA operators.

param
itemID the ID of the item to read.
return
the NV item as a String, or null on any failure.

public booleannvResetConfig(int resetType)
Perform the specified type of NV config reset. The radio will be taken offline and the device must be rebooted after the operation. Used for device configuration by some CDMA operators.

param
resetType the type of reset to perform (1 == factory reset; 2 == NV-only reset).
return
true on success; false on any failure.

public booleannvWriteCdmaPrl(byte[] preferredRoamingList)
Update the CDMA Preferred Roaming List (PRL) in the radio NV storage. Used for device configuration by some CDMA operators.

param
preferredRoamingList byte array containing the new PRL.
return
true on success; false on any failure.

public booleannvWriteItem(int itemID, java.lang.String itemValue)
Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}. Used for device configuration by some CDMA operators.

param
itemID the ID of the item to read.
param
itemValue the value to write, as a String.
return
true on success; false on any failure.

public java.lang.StringsendEnvelopeWithStatus(java.lang.String content)
Send ENVELOPE to the SIM and returns the response.

param
contents String containing SAT/USAT response in hexadecimal format starting with command tag. See TS 102 223 for details.
return
The APDU response from the ICC card, with the last 4 bytes being the status word. If the command fails, returns an empty string.

public voidsetCellInfoListRate(int rateInMillis)
Sets minimum time in milli-seconds between onCellInfoChanged

public voidsetDataEnabled(int subId, boolean enable)
User enable/disable Mobile Data.

param
enable true to turn on, else false

public voidsetImsRegistrationState(boolean registered)
Set IMS registration state

public booleansetLine1NumberForDisplayForSubscriber(int subId, java.lang.String alphaTag, java.lang.String number)
Set the line 1 phone number string and its alphatag for the current ICCID for display purpose only, for example, displayed in Phone Status. It won't change the actual MSISDN/MDN. To unset alphatag or number, pass in a null value.

param
subId the subscriber that the alphatag and dialing number belongs to.
param
alphaTag alpha-tagging of the dailing nubmer
param
number The dialing number
return
true if the operation was executed correctly.

public booleansetOperatorBrandOverride(java.lang.String brand)
Override the operator 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 Permission: {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or has to be carrier app - see #hasCarrierPrivileges.

param
brand The brand name to display/set.
return
true if the operation was executed correctly.

public booleansetPreferredNetworkType(int networkType)
Set the preferred network type. Used for device configuration by some CDMA operators.

param
networkType the preferred network type, defined in RILConstants.java.
return
true on success; false on any failure.

public booleansetRadio(boolean turnOn)
Set the radio to on or off

public voidsetRadioCapability(android.telephony.RadioAccessFamily[] rafs)
Set phone radio type and access technology.

param
rafs an RadioAccessFamily array to indicate all phone's new radio access family. The length of RadioAccessFamily must equ]]al to phone count.

public booleansetRadioForSubscriber(int subId, boolean turnOn)
Set the radio to on or off on particular subId.

param
subId user preferred subId.

public booleansetRadioPower(boolean turnOn)
Set the radio to on or off unconditionally

public booleansetRoamingOverride(java.util.List gsmRoamingList, java.util.List gsmNonRoamingList, java.util.List cdmaRoamingList, java.util.List cdmaNonRoamingList)
Override the roaming indicator for the current ICCID. Using this call, the carrier app (see #hasCarrierPrivileges) can override the platform's notion of a network operator being considered roaming or not. The change only affects the ICCID that was active when this call was made. If null is passed as any of the input, the corresponding value is deleted.

Requires that the caller have carrier privilege. See #hasCarrierPrivileges.

param
gsmRoamingList - List of MCCMNCs to be considered roaming for 3GPP RATs.
param
gsmNonRoamingList - List of MCCMNCs to be considered not roaming for 3GPP RATs.
param
cdmaRoamingList - List of SIDs to be considered roaming for 3GPP2 RATs.
param
cdmaNonRoamingList - List of SIDs to be considered not roaming for 3GPP2 RATs.
return
true if the operation was executed correctly.

public booleansetVoiceMailNumber(int subId, java.lang.String alphaTag, java.lang.String number)
Sets the voicemail number for a particular subscriber.

public voidshutdownMobileRadios()
Shutdown Mobile Radios

public voidsilenceRinger()
Silence the ringer if an incoming call is currently ringing. (If vibrating, stop the vibrator also.) It's safe to call this if the ringer has already been silenced, or even if there's no incoming call. (If so, this method will do nothing.) TODO: this should be a oneway call too (see above). (Actually *all* the methods here that return void can probably be oneway.)

public booleansupplyPin(java.lang.String pin)
Supply a pin to unlock the SIM. Blocks until a result is determined.

param
pin The pin to check.
return
whether the operation was a success.

public booleansupplyPinForSubscriber(int subId, java.lang.String pin)
Supply a pin to unlock the SIM for particular subId. Blocks until a result is determined.

param
pin The pin to check.
param
subId user preferred subId.
return
whether the operation was a success.

public int[]supplyPinReportResult(java.lang.String pin)
Supply a pin to unlock the SIM. Blocks until a result is determined. Returns a specific success/error code.

param
pin The pin to check.
return
retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code retValue[1] = number of attempts remaining if known otherwise -1

public int[]supplyPinReportResultForSubscriber(int subId, java.lang.String pin)
Supply a pin to unlock the SIM. Blocks until a result is determined. Returns a specific success/error code.

param
pin The pin to check.
return
retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code retValue[1] = number of attempts remaining if known otherwise -1

public booleansupplyPuk(java.lang.String puk, java.lang.String pin)
Supply puk to unlock the SIM and set SIM pin to new pin. Blocks until a result is determined.

param
puk The puk to check. pin The new pin to be set in SIM
return
whether the operation was a success.

public booleansupplyPukForSubscriber(int subId, java.lang.String puk, java.lang.String pin)
Supply puk to unlock the SIM and set SIM pin to new pin. Blocks until a result is determined.

param
puk The puk to check. pin The new pin to be set in SIM
param
subId user preferred subId.
return
whether the operation was a success.

public int[]supplyPukReportResult(java.lang.String puk, java.lang.String pin)
Supply puk to unlock the SIM and set SIM pin to new pin. Blocks until a result is determined. Returns a specific success/error code

param
puk The puk to check pin The pin to check.
return
retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code retValue[1] = number of attempts remaining if known otherwise -1

public int[]supplyPukReportResultForSubscriber(int subId, java.lang.String puk, java.lang.String pin)
Supply puk to unlock the SIM and set SIM pin to new pin. Blocks until a result is determined. Returns a specific success/error code

param
puk The puk to check pin The pin to check.
return
retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code retValue[1] = number of attempts remaining if known otherwise -1

public voidtoggleRadioOnOff()
Toggles the radio on or off.

public voidtoggleRadioOnOffForSubscriber(int subId)
Toggles the radio on or off on particular subId.

param
subId user preferred subId.

public voidupdateServiceLocation()
Request to update location information in service state

public voidupdateServiceLocationForSubscriber(int subId)
Request to update location information for a subscrition in service state

param
subId user preferred subId.