FileDocCategorySizeDatePackage
Phone.javaAPI DocAndroid 1.5 API41426Wed May 06 22:42:00 BST 2009com.android.internal.telephony

Phone

public interface Phone
Internal interface used to control the phone; SDK developers cannot obtain this interface. {@hide}

Fields Summary
static final boolean
DEBUG_PHONE
used to enable additional debug messages
static final String
STATE_KEY
static final String
PHONE_NAME_KEY
static final String
FAILURE_REASON_KEY
static final String
STATE_CHANGE_REASON_KEY
static final String
DATA_APN_TYPE_KEY
static final String
DATA_APN_KEY
static final String
DATA_IFACE_NAME_KEY
static final String
NETWORK_UNAVAILABLE_KEY
static final String
APN_TYPE_ALL
APN types for data connections. These are usage categories for an APN entry. One APN entry may support multiple APN types, eg, a single APN may service regular internet traffic ("default") as well as MMS-specific connections.
APN_TYPE_ALL is a special type to indicate that this APN entry can service all data connections.
static final String
APN_TYPE_DEFAULT
APN type for default data traffic
static final String
APN_TYPE_MMS
APN type for MMS traffic
static final String
FEATURE_ENABLE_MMS
static final int
APN_ALREADY_ACTIVE
Return codes for enableApnType()
static final int
APN_REQUEST_STARTED
static final int
APN_TYPE_NOT_AVAILABLE
static final int
APN_REQUEST_FAILED
static final String
REASON_ROAMING_ON
Optional reasons for disconnect and connect
static final String
REASON_ROAMING_OFF
static final String
REASON_DATA_DISABLED
static final String
REASON_DATA_ENABLED
static final String
REASON_GPRS_ATTACHED
static final String
REASON_GPRS_DETACHED
static final String
REASON_APN_CHANGED
static final String
REASON_APN_SWITCHED
static final String
REASON_RESTORE_DEFAULT_APN
static final String
REASON_RADIO_TURNED_OFF
static final String
REASON_PDP_RESET
static final String
REASON_VOICE_CALL_ENDED
static final String
REASON_VOICE_CALL_STARTED
static final String
REASON_PS_RESTRICT_ENABLED
static final String
REASON_PS_RESTRICT_DISABLED
static final String
REASON_SIM_LOADED
static final int
BM_UNSPECIFIED
static final int
BM_EURO_BAND
static final int
BM_US_BAND
static final int
BM_JPN_BAND
static final int
BM_AUS_BAND
static final int
BM_AUS2_BAND
static final int
BM_BOUNDARY
static final int
NT_AUTO_TYPE
static final int
NT_GSM_TYPE
static final int
NT_WCDMA_TYPE
Constructors Summary
Methods Summary
public voidacceptCall()
Answers a ringing or waiting call. Active calls, if any, go on hold. Answering occurs asynchronously, and final notification occurs via {@link #registerForPhoneStateChanged(android.os.Handler, int, java.lang.Object) registerForPhoneStateChanged()}.

exception
CallStateException when no call is ringing or waiting

public booleancanConference()
Whether or not the phone can conference in the current phone state--that is, one call holding and one call active.

return
true if the phone can conference; false otherwise.

public booleancanTransfer()
Whether or not the phone can do explicit call transfer in the current phone state--that is, one call holding and one call active.

return
true if the phone can do explicit call transfer; false otherwise.

public voidclearDisconnected()
Clears all DISCONNECTED connections from Call connection lists. Calls that were in the DISCONNECTED state become idle. This occurs synchronously.

public voidconference()
Conferences holding and active. Conference occurs asynchronously and may fail. Final notification occurs via {@link #registerForPhoneStateChanged(android.os.Handler, int, java.lang.Object) registerForPhoneStateChanged()}.

exception
CallStateException if canConference() would return false. In these cases, this operation may not be performed.

public Connectiondial(java.lang.String dialString)
Initiate a new voice connection. This happens asynchronously, so you cannot assume the audio path is connected (or a call index has been assigned) until PhoneStateChanged notification has occurred.

exception
CallStateException if a new outgoing call is not currently possible because no more call slots exist or a call exists that is dialing, alerting, ringing, or waiting. Other errors are handled asynchronously.

public intdisableApnType(java.lang.String type)
Disables the specified APN type, and switches back to the default APN, if necessary. Switching to the default APN will not happen if default data traffic has been explicitly disabled via a call to {@link #disableDataConnectivity}.

Only works for "special" APN types, i.e., not the default APN.

param
type The desired APN type. Cannot be {@link #APN_TYPE_DEFAULT}.
return
APN_ALREADY_ACTIVE if the default APN is already active.
APN_REQUEST_STARTED if the request to switch to the default APN has been initiated.
APN_REQUEST_FAILED if the request was invalid.
A ACTION_ANY_DATA_CONNECTION_STATE_CHANGED broadcast will indicate connection state progress.

public booleandisableDataConnectivity()
Disallow mobile data connections, and terminate any that are in progress.

return
{@code true} if the operation started successfully
{@code false} if it failed immediately.
Even in the {@code true} case, it may still fail later during setup, in which case an asynchronous indication will be supplied.

public voiddisableLocationUpdates()
Disable location update notifications.

public intenableApnType(java.lang.String type)
Enables the specified APN type. Only works for "special" APN types, i.e., not the default APN.

param
type The desired APN type. Cannot be {@link #APN_TYPE_DEFAULT}.
return
APN_ALREADY_ACTIVE if the current APN services the requested type.
APN_TYPE_NOT_AVAILABLE if the carrier does not support the requested APN.
APN_REQUEST_STARTED if the request has been initiated.
APN_REQUEST_FAILED if the request was invalid.
A ACTION_ANY_DATA_CONNECTION_STATE_CHANGED broadcast will indicate connection state progress.

public booleanenableDataConnectivity()
Allow mobile data connections.

return
{@code true} if the operation started successfully
{@code false} if it failed immediately.
Even in the {@code true} case, it may still fail later during setup, in which case an asynchronous indication will be supplied.

public voidenableLocationUpdates()
Enable location update notifications.

public voidexplicitCallTransfer()
Connects the two calls and disconnects the subscriber from both calls Explicit Call Transfer occurs asynchronously and may fail. Final notification occurs via {@link #registerForPhoneStateChanged(android.os.Handler, int, java.lang.Object) registerForPhoneStateChanged()}.

exception
CallStateException if canTransfer() would return false. In these cases, this operation may not be performed.

public java.lang.StringgetActiveApn()
Returns a string identifier for currently active or last connected APN.

return
The string name.

public java.lang.String[]getActiveApnTypes()
Returns an array of string identifiers for the APN types serviced by the currently active or last connected APN.

return
The string array.

public voidgetAvailableNetworks(android.os.Message response)
Scan available networks. This method is asynchronous; . On completion, response.obj is set to an AsyncResult with one of the following members:.

  • response.obj.result will be a List of com.android.internal.telephony.gsm.NetworkInfo objects, or
  • response.obj.exception will be set with an exception on failure.

public CallgetBackgroundCall()
Gets the background call object, which represents all connections that are holding (all connections that have been accepted or connected, but do not have their audio path connected).

The background call is a singleton object. It is constant for the life of this phone object . It is never null.

The background call will only ever be in one of these states: IDLE, HOLDING or DISCONNECTED. State change notification is available via {@link #registerForPhoneStateChanged(android.os.Handler, int, java.lang.Object) registerForPhoneStateChanged()}.

public booleangetCallForwardingIndicator()
Get voice call forwarding indicator status. No change notification available on this interface. Use PhoneStateNotifier or similar instead.

return
true if there is a voice call forwarding

public voidgetCallForwardingOption(int commandInterfaceCFReason, android.os.Message onComplete)
getCallForwardingOptions gets a call forwarding option. The return value of ((AsyncResult)onComplete.obj) is an array of CallForwardInfo.

param
commandInterfaceCFReason is one of the valid call forwarding CF_REASONS, as defined in com.android.internal.telephony.gsm.CommandsInterface
param
onComplete a callback message when the action is completed.
see
com.android.internal.telephony.gsm.CallForwardInfo for details.

public voidgetCallWaiting(android.os.Message onComplete)
getCallWaiting gets call waiting activation state. The return value of ((AsyncResult)onComplete.obj) is an array of int, with a length of 1.

param
onComplete a callback message when the action is completed.
see
com.android.internal.telephony.gsm.CommandsInterface.queryCallWaiting for details.

public android.telephony.CellLocationgetCellLocation()
Get the current CellLocation.

public android.content.ContextgetContext()
Gets the context for the phone, as set at initialization time.

public java.util.ListgetCurrentPdpList()
Get current mutiple PDP link status

return
list of pdp link connections

public com.android.internal.telephony.Phone$DataActivityStategetDataActivityState()
Get the current DataActivityState. No change notification exists at this interface -- use {@link TelephonyManager} instead.

public com.android.internal.telephony.Phone$DataStategetDataConnectionState()
Get the current DataState. No change notification exists at this interface -- use {@link com.android.internal.telephony.PhoneStateIntentReceiver PhoneStateIntentReceiver} instead.

public booleangetDataRoamingEnabled()

return
true if enable data connection on roaming

public java.lang.StringgetDeviceId()
Retrieves the unique device ID, e.g., IMEI for GSM phones.

public java.lang.StringgetDeviceSvn()
Retrieves the software version number for the device, e.g., IMEI/SV for GSM phones.

public java.lang.String[]getDnsServers(java.lang.String apnType)
Returns the DNS servers for the network interface used by the specified APN type.

public CallgetForegroundCall()
Gets the foreground call object, which represents all connections that are dialing or active (all connections that have their audio path connected).

The foreground call is a singleton object. It is constant for the life of this phone. It is never null.

The foreground call will only ever be in one of these states: IDLE, ACTIVE, DIALING, ALERTING, or DISCONNECTED. State change notification is available via {@link #registerForPhoneStateChanged(android.os.Handler, int, java.lang.Object) registerForPhoneStateChanged()}.

public java.lang.StringgetGateway(java.lang.String apnType)
Returns the gateway for the network interface used by the specified APN type.

public java.lang.StringgetInterfaceName(java.lang.String apnType)
Returns the name of the network interface used by the specified APN type.

public java.lang.StringgetIpAddress(java.lang.String apnType)
Returns the IP address of the network interface used by the specified APN type.

public java.lang.StringgetLine1AlphaTag()
Returns the alpha tag associated with the msisdn number. If there is no alpha tag associated or the record is not yet available, returns a default localized string.

public java.lang.StringgetLine1Number()
Get the line 1 phone number (MSISDN).

return
phone number. May return null if not available or the SIM is not ready

public booleangetMessageWaitingIndicator()
Get voice message waiting indicator status. No change notification available on this interface. Use PhoneStateNotifier or similar instead.

return
true if there is a voice message waiting

public booleangetMute()
Gets current mute status. Use {@link #registerForPhoneStateChanged(android.os.Handler, int, java.lang.Object) registerForPhoneStateChanged()} as a change notifcation, although presently phone state changed is not fired when setMute() is called.

return
true is muting, false is unmuting

public voidgetNeighboringCids(android.os.Message response)
Query neighboring cell IDs. response is dispatched when this is complete. response.obj will be an AsyncResult, and response.obj.exception will be non-null on failure. On success, AsyncResult.result will be a String[] containing the neighboring cell IDs. Index 0 will contain the count of available cell IDs. Cell IDs are in hexadecimal format.

param
response callback message that is dispatched when the query completes.

public voidgetOutgoingCallerIdDisplay(android.os.Message onComplete)
getOutgoingCallerIdDisplay gets outgoing caller id display. The return value of ((AsyncResult)onComplete.obj) is an array of int, with a length of 2.

param
onComplete a callback message when the action is completed.
see
com.android.internal.telephony.gsm.CommandsInterface.getCLIR for details.

public voidgetPdpContextList(android.os.Message response)
Get the current active PDP context list

param
response On success, "response" bytes is made available as: (String[])(((AsyncResult)response.obj).result). On failure, (((AsyncResult)response.obj).result) == null and (((AsyncResult)response.obj).exception) being an instance of com.android.internal.telephony.gsm.CommandException

public java.util.ListgetPendingMmiCodes()
Returns a list of MMI codes that are pending. (They have initiated but have not yet completed). Presently there is only ever one. Use registerForMmiInitiate and registerForMmiComplete for change notification.

public java.lang.StringgetPhoneName()
Returns a string identifier for this phone interface for parties outside the phone app process.

return
The string name.

public voidgetPreferredNetworkType(android.os.Message response)
Query the preferred network type setting

param
response is callback message to report one of NT_*_TYPE

public CallgetRingingCall()
Gets the ringing call object, which represents an incoming connection (if present) that is pending answer/accept. (This connection may be RINGING or WAITING, and there may be only one.)

The ringing call is a singleton object. It is constant for the life of this phone. It is never null.

The ringing call will only ever be in one of these states: IDLE, INCOMING, WAITING or DISCONNECTED. State change notification is available via {@link #registerForPhoneStateChanged(android.os.Handler, int, java.lang.Object) registerForPhoneStateChanged()}.

public android.telephony.ServiceStategetServiceState()
Get the current ServiceState. Use registerForServiceStateChanged to be informed of updates.

public intgetSignalStrengthASU()
Get current signal strength. No change notification available on this interface. Use PhoneStateNotifier or an equivalent. An ASU is 0-31 or -1 if unknown (for GSM, dBm = -113 - 2 * asu). The following special values are defined:

  • 0 means "-113 dBm or less".
  • 31 means "-51 dBm or greater".

return
Current signal strength in ASU's.

public SimCardgetSimCard()
Returns the SIM card interface for this phone, or null if not applicable to underlying technology.

public booleangetSimRecordsLoaded()
Returns SIM record load state. Use getSimCard().registerForReady() for change notification.

return
true if records from the SIM have been loaded and are available (if applicable). If not applicable to the underlying technology, returns true as well.

public java.lang.StringgetSimSerialNumber()
Retrieves the serial number of the SIM, if applicable.

public com.android.internal.telephony.test.SimulatedRadioControlgetSimulatedRadioControl()
If this is a simulated phone interface, returns a SimulatedRadioControl.

return A SimulatedRadioControl if this is a simulated interface; otherwise, null.

public com.android.internal.telephony.Phone$StategetState()
Get current coarse-grained voice call state. Use {@link #registerForPhoneStateChanged(Handler, int, Object) registerForPhoneStateChanged()} for change notification.

If the phone has an active call and call waiting occurs, then the phone state is RINGING not OFFHOOK Note: This registration point provides notification of finer-grained changes.

public java.lang.StringgetSubscriberId()
Retrieves the unique sbuscriber ID, e.g., IMSI for GSM phones.

public booleangetUnitTestMode()

return
true If unit test mode is enabled

public java.lang.StringgetVoiceMailAlphaTag()
Returns the alpha tag associated with the voice mail number. If there is no alpha tag associated or the record is not yet available, returns a default localized string.

Please use this value instead of some other localized string when showing a name for this number in the UI. For example, call log entries should show this alpha tag.

Usage of this alpha tag in the UI is a common carrier requirement.

public java.lang.StringgetVoiceMailNumber()
Get the voice mail access phone number. Typically dialed when the user holds the "1" key in the phone app. May return null if not available or the SIM is not ready.

public booleanhandleInCallMmiCommands(java.lang.String command)
Handles in-call MMI commands. While in a call, or while receiving a call, use this to execute MMI commands. see 3GPP 20.030, section 6.5.5.1 for specs on the allowed MMI commands.

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

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 voidinvokeOemRilRequestRaw(byte[] data, android.os.Message response)
Invokes RIL_REQUEST_OEM_HOOK_RAW on RIL implementation.

param
data The data for the request.
param
response On success, (byte[])(((AsyncResult)response.obj).result) On failure, (((AsyncResult)response.obj).result) == null and (((AsyncResult)response.obj).exception) being an instance of com.android.internal.telephony.gsm.CommandException
see
#invokeOemRilRequestRaw(byte[], android.os.Message)

public voidinvokeOemRilRequestStrings(java.lang.String[] strings, android.os.Message response)
Invokes RIL_REQUEST_OEM_HOOK_Strings on RIL implementation.

param
strings The strings to make available as the request data.
param
response On success, "response" bytes is made available as: (String[])(((AsyncResult)response.obj).result). On failure, (((AsyncResult)response.obj).result) == null and (((AsyncResult)response.obj).exception) being an instance of com.android.internal.telephony.gsm.CommandException
see
#invokeOemRilRequestStrings(java.lang.String[], android.os.Message)

public booleanisDataConnectivityPossible()
Report on whether data connectivity is allowed.

public voidqueryAvailableBandMode(android.os.Message response)
Query the list of band mode supported by RF.

param
response is callback message ((AsyncResult)response.obj).result is an int[] with every element representing one avialable BM_*_BAND

public voidregisterForDisconnect(android.os.Handler h, int what, java.lang.Object obj)
Notifies when a voice connection has disconnected, either due to local or remote hangup or error. Messages received from this will have the following members:

  • Message.obj will be an AsyncResult
  • AsyncResult.userObj = obj
  • AsyncResult.result = a Connection object that is no longer connected.

public voidregisterForIncomingRing(android.os.Handler h, int what, java.lang.Object obj)
Notifies when an incoming call rings.

Messages received from this: Message.obj will be an AsyncResult AsyncResult.userObj = obj AsyncResult.result = a Connection.

public voidregisterForMmiComplete(android.os.Handler h, int what, java.lang.Object obj)
Register for notifications that an MMI request has completed its network activity and is in its final state. This may mean a state of COMPLETE, FAILED, or CANCELLED. Message.obj will contain an AsyncResult. obj.result will be an "MmiCode" object

public voidregisterForMmiInitiate(android.os.Handler h, int what, java.lang.Object obj)
Register for notifications of initiation of a new MMI code request. MMI codes for GSM are discussed in 3GPP TS 22.030.

Example: If Phone.dial is called with "*#31#", then the app will be notified here.

The returned Message.obj will contain an AsyncResult. obj.result will be an "MmiCode" object.

public voidregisterForNewRingingConnection(android.os.Handler h, int what, java.lang.Object obj)
Notifies when a new ringing or waiting connection has appeared.

Messages received from this: Message.obj will be an AsyncResult AsyncResult.userObj = obj AsyncResult.result = a Connection.

Please check Connection.isRinging() to make sure the Connection has not dropped since this message was posted. If Connection.isRinging() is true, then Connection.getCall() == Phone.getRingingCall()

public voidregisterForPhoneStateChanged(android.os.Handler h, int what, java.lang.Object obj)
Notifies when any aspect of the voice call state changes. Resulting events will have an AsyncResult in Message.obj. AsyncResult.userData will be set to the obj argument here. The h parameter is held only by a weak reference.

public voidregisterForServiceStateChanged(android.os.Handler h, int what, java.lang.Object obj)
Register for ServiceState changed. Message.obj will contain an AsyncResult. AsyncResult.result will be a ServiceState instance

public voidregisterForSuppServiceFailed(android.os.Handler h, int what, java.lang.Object obj)
Register for notifications when a supplementary service attempt fails. Message.obj will contain an AsyncResult.

param
h Handler that receives the notification message.
param
what User-defined message code.
param
obj User object.

public voidregisterForSuppServiceNotification(android.os.Handler h, int what, java.lang.Object obj)
Register for Supplementary Service notifications from the network. Message.obj will contain an AsyncResult. AsyncResult.result will be a SuppServiceNotification instance.

param
h Handler that receives the notification message.
param
what User-defined message code.
param
obj User object.

public voidregisterForUnknownConnection(android.os.Handler h, int what, java.lang.Object obj)
Notifies when a previously untracked non-ringing/waiting connection has appeared. This is likely due to some other entity (eg, SIM card application) initiating a call.

public voidrejectCall()
Reject (ignore) a ringing call. In GSM, this means UDUB (User Determined User Busy). Reject occurs asynchronously, and final notification occurs via {@link #registerForPhoneStateChanged(android.os.Handler, int, java.lang.Object) registerForPhoneStateChanged()}.

exception
CallStateException when no call is ringing or waiting

public voidselectNetworkManually(com.android.internal.telephony.gsm.NetworkInfo network, android.os.Message response)
Manually selects a network. response is dispatched when this is complete. response.obj will be an AsyncResult, and response.obj.exception will be non-null on failure.

see
#setNetworkSelectionModeAutomatic(Message)

public voidsendDtmf(char c)
Play a DTMF tone on the active call. Ignored if there is no active call.

param
c should be one of 0-9, '*' or '#'. Other values will be silently ignored.

public voidsendUssdResponse(java.lang.String ussdMessge)
Sends user response to a USSD REQUEST message. An MmiCode instance representing this response is sent to handlers registered with registerForMmiInitiate.

param
ussdMessge Message to send in the response.

public voidsetBandMode(int bandMode, android.os.Message response)
Assign a specified band for RF configuration.

param
bandMode one of BM_*_BAND
param
response is callback message

public voidsetCallForwardingOption(int commandInterfaceCFReason, int commandInterfaceCFAction, java.lang.String dialingNumber, int timerSeconds, android.os.Message onComplete)
setCallForwardingOptions sets a call forwarding option.

param
commandInterfaceCFReason is one of the valid call forwarding CF_REASONS, as defined in com.android.internal.telephony.gsm.CommandsInterface
param
commandInterfaceCFAction is one of the valid call forwarding CF_ACTIONS, as defined in com.android.internal.telephony.gsm.CommandsInterface
param
dialingNumber is the target phone number to forward calls to
param
timerSeconds is used by CFNRy to indicate the timeout before forwarding is attempted.
param
onComplete a callback message when the action is completed.

public voidsetCallWaiting(boolean enable, android.os.Message onComplete)
setCallWaiting sets a call forwarding option.

param
enable is a boolean representing the state that you are requesting, true for enabled, false for disabled.
param
onComplete a callback message when the action is completed.

public voidsetDataRoamingEnabled(boolean enable)

param
enable set true if enable data connection on roaming

public voidsetLine1Number(java.lang.String alphaTag, java.lang.String number, android.os.Message onComplete)
Sets the MSISDN phone number in the SIM card.

param
alphaTag the alpha tag associated with the MSISDN phone number (see getMsisdnAlphaTag)
param
number the new MSISDN phone number to be set on the SIM.
param
onComplete a callback message when the action is completed.

public voidsetMute(boolean muted)
Mutes or unmutes the microphone for the active call. The microphone is automatically unmuted if a call is answered, dialed, or resumed from a holding state.

param
muted true to mute the microphone, false to activate the microphone.

public voidsetNetworkSelectionModeAutomatic(android.os.Message response)
Switches network selection mode to "automatic", re-scanning and re-selecting a network if appropriate.

param
response The message to dispatch when the network selection is complete.
see
#selectNetworkManually(com.android.internal.telephony.gsm.NetworkInfo, android.os.Message )

public voidsetOnPostDialCharacter(android.os.Handler h, int what, java.lang.Object obj)
Sets an event to be fired when the telephony system processes a post-dial character on an outgoing call.

Messages of type what will be sent to h. The obj field of these Message's will be instances of AsyncResult. Message.obj.result will be a Connection object.

Message.arg1 will be the post dial character being processed, or 0 ('\0') if end of string.

If Connection.getPostDialState() == WAIT, the application must call {@link com.android.internal.telephony.Connection#proceedAfterWaitChar() Connection.proceedAfterWaitChar()} or {@link com.android.internal.telephony.Connection#cancelPostDial() Connection.cancelPostDial()} for the telephony system to continue playing the post-dial DTMF sequence.

If Connection.getPostDialState() == WILD, the application must call {@link com.android.internal.telephony.Connection#proceedAfterWildChar Connection.proceedAfterWildChar()} or {@link com.android.internal.telephony.Connection#cancelPostDial() Connection.cancelPostDial()} for the telephony system to continue playing the post-dial DTMF sequence.

Only one post dial character handler may be set.

Calling this method with "h" equal to null unsets this handler.

public voidsetOutgoingCallerIdDisplay(int commandInterfaceCLIRMode, android.os.Message onComplete)
setOutgoingCallerIdDisplay sets a call forwarding option.

param
commandInterfaceCLIRMode is one of the valid call CLIR modes, as defined in com.android.internal.telephony.gsm.CommandsInterface
param
onComplete a callback message when the action is completed.

public voidsetPreferredNetworkType(int networkType, android.os.Message response)
Requests to set the preferred network type for searching and registering (CS/PS domain, RAT, and operation mode)

param
networkType one of NT_*_TYPE
param
response is callback message

public voidsetRadioPower(boolean power)
Sets the radio power on/off state (off is sometimes called "airplane mode"). Current state can be gotten via {@link #getServiceState()}.{@link android.telephony.ServiceState#getState() getState()}. Note: This request is asynchronous. getServiceState().getState() will not change immediately after this call. registerForServiceStateChanged() to find out when the request is complete.

param
power true means "on", false means "off".

public voidsetUnitTestMode(boolean f)
For unit tests; don't send notifications to "Phone" mailbox registrants if true.

public voidsetVoiceMailNumber(java.lang.String alphaTag, java.lang.String voiceMailNumber, android.os.Message onComplete)
setVoiceMailNumber sets the voicemail number in the SIM card.

param
alphaTag the alpha tag associated with the voice mail number (see getVoiceMailAlphaTag)
param
voiceMailNumber the new voicemail number to be set on the SIM.
param
onComplete a callback message when the action is completed.

public voidstartDtmf(char c)
Start to paly a DTMF tone on the active call. Ignored if there is no active call or there is a playing DTMF tone.

param
c should be one of 0-9, '*' or '#'. Other values will be silently ignored.

public voidstopDtmf()
Stop the playing DTMF tone. Ignored if there is no playing DTMF tone or no active call.

public voidswitchHoldingAndActive()
Places any active calls on hold, and makes any held calls active. Switch occurs asynchronously and may fail. Final notification occurs via {@link #registerForPhoneStateChanged(android.os.Handler, int, java.lang.Object) registerForPhoneStateChanged()}.

exception
CallStateException if a call is ringing, waiting, or dialing/alerting. In these cases, this operation may not be performed.

public voidunregisterForDisconnect(android.os.Handler h)
Unregisters for voice disconnection notification. Extraneous calls are tolerated silently

public voidunregisterForIncomingRing(android.os.Handler h)
Unregisters for ring notification. Extraneous calls are tolerated silently

public voidunregisterForMmiComplete(android.os.Handler h)
Unregisters for MMI complete notification. Extraneous calls are tolerated silently

public voidunregisterForMmiInitiate(android.os.Handler h)
Unregisters for new MMI initiate notification. Extraneous calls are tolerated silently

public voidunregisterForNewRingingConnection(android.os.Handler h)
Unregisters for new ringing connection notification. Extraneous calls are tolerated silently

public voidunregisterForPhoneStateChanged(android.os.Handler h)
Unregisters for voice call state change notifications. Extraneous calls are tolerated silently.

public voidunregisterForServiceStateChanged(android.os.Handler h)
Unregisters for ServiceStateChange notification. Extraneous calls are tolerated silently

public voidunregisterForSuppServiceFailed(android.os.Handler h)
Unregister for notifications when a supplementary service attempt fails. Extraneous calls are tolerated silently

param
h Handler to be removed from the registrant list.

public voidunregisterForSuppServiceNotification(android.os.Handler h)
Unregisters for Supplementary Service notifications. Extraneous calls are tolerated silently

param
h Handler to be removed from the registrant list.

public voidunregisterForUnknownConnection(android.os.Handler h)
Unregisters for unknown connection notifications.

public voidupdateServiceLocation(android.os.Message response)
Udpate LAC and CID in service state for currnet GSM netowrk registration If get different LAC and/or CID, notifyServiceState will be sent

param
On failure, (((AsyncResult)response.obj).result) == null and (((AsyncResult)response.obj).exception) being an instance of com.android.internal.telephony.gsm.CommandException