Methods Summary |
---|
public void | acceptCall()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()}.
|
public boolean | canConference()Whether or not the phone can conference in the current phone
state--that is, one call holding and one call active.
|
public boolean | canTransfer()Whether or not the phone can do explicit call transfer in the current
phone state--that is, one call holding and one call active.
|
public void | clearDisconnected()Clears all DISCONNECTED connections from Call connection lists.
Calls that were in the DISCONNECTED state become idle. This occurs
synchronously.
|
public void | conference()Conferences holding and active. Conference occurs asynchronously
and may fail. Final notification occurs via
{@link #registerForPhoneStateChanged(android.os.Handler, int,
java.lang.Object) registerForPhoneStateChanged()}.
|
public Connection | dial(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.
|
public int | disableApnType(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.
|
public boolean | disableDataConnectivity()Disallow mobile data connections, and terminate any that
are in progress.
|
public void | disableLocationUpdates()Disable location update notifications.
|
public int | enableApnType(java.lang.String type)Enables the specified APN type. Only works for "special" APN types,
i.e., not the default APN.
|
public boolean | enableDataConnectivity()Allow mobile data connections.
|
public void | enableLocationUpdates()Enable location update notifications.
|
public void | explicitCallTransfer()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()}.
|
public java.lang.String | getActiveApn()Returns a string identifier for currently active or last connected APN.
|
public java.lang.String[] | getActiveApnTypes()Returns an array of string identifiers for the APN types serviced by the
currently active or last connected APN.
|
public void | getAvailableNetworks(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 Call | getBackgroundCall()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 boolean | getCallForwardingIndicator()Get voice call forwarding indicator status. No change notification
available on this interface. Use PhoneStateNotifier or similar instead.
|
public void | getCallForwardingOption(int commandInterfaceCFReason, android.os.Message onComplete)getCallForwardingOptions
gets a call forwarding option. The return value of
((AsyncResult)onComplete.obj) is an array of CallForwardInfo.
|
public void | getCallWaiting(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.
|
public android.telephony.CellLocation | getCellLocation()Get the current CellLocation.
|
public android.content.Context | getContext()Gets the context for the phone, as set at initialization time.
|
public java.util.List | getCurrentPdpList()Get current mutiple PDP link status
|
public com.android.internal.telephony.Phone$DataActivityState | getDataActivityState()Get the current DataActivityState. No change notification exists at this
interface -- use
{@link TelephonyManager} instead.
|
public com.android.internal.telephony.Phone$DataState | getDataConnectionState()Get the current DataState. No change notification exists at this
interface -- use
{@link com.android.internal.telephony.PhoneStateIntentReceiver PhoneStateIntentReceiver} instead.
|
public boolean | getDataRoamingEnabled()
|
public java.lang.String | getDeviceId()Retrieves the unique device ID, e.g., IMEI for GSM phones.
|
public java.lang.String | getDeviceSvn()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 Call | getForegroundCall()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.String | getGateway(java.lang.String apnType)Returns the gateway for the network interface used by the specified APN
type.
|
public java.lang.String | getInterfaceName(java.lang.String apnType)Returns the name of the network interface used by the specified APN type.
|
public java.lang.String | getIpAddress(java.lang.String apnType)Returns the IP address of the network interface used by the specified
APN type.
|
public java.lang.String | getLine1AlphaTag()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.String | getLine1Number()Get the line 1 phone number (MSISDN).
|
public boolean | getMessageWaitingIndicator()Get voice message waiting indicator status. No change notification
available on this interface. Use PhoneStateNotifier or similar instead.
|
public boolean | getMute()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.
|
public void | getNeighboringCids(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.
|
public void | getOutgoingCallerIdDisplay(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.
|
public void | getPdpContextList(android.os.Message response)Get the current active PDP context list
|
public java.util.List | getPendingMmiCodes()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.String | getPhoneName()Returns a string identifier for this phone interface for parties
outside the phone app process.
|
public void | getPreferredNetworkType(android.os.Message response)Query the preferred network type setting
|
public Call | getRingingCall()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.ServiceState | getServiceState()Get the current ServiceState. Use
registerForServiceStateChanged to be informed of
updates.
|
public int | getSignalStrengthASU()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".
|
public SimCard | getSimCard()Returns the SIM card interface for this phone, or null
if not applicable to underlying technology.
|
public boolean | getSimRecordsLoaded()Returns SIM record load state. Use
getSimCard().registerForReady() for change notification.
|
public java.lang.String | getSimSerialNumber()Retrieves the serial number of the SIM, if applicable.
|
public com.android.internal.telephony.test.SimulatedRadioControl | getSimulatedRadioControl()If this is a simulated phone interface, returns a SimulatedRadioControl.
|
public com.android.internal.telephony.Phone$State | getState()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.String | getSubscriberId()Retrieves the unique sbuscriber ID, e.g., IMSI for GSM phones.
|
public boolean | getUnitTestMode()
|
public java.lang.String | getVoiceMailAlphaTag()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.String | getVoiceMailNumber()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 boolean | handleInCallMmiCommands(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.
|
public boolean | handlePinMmi(java.lang.String dialString)Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
without SEND (so dial is not appropriate).
|
public void | invokeOemRilRequestRaw(byte[] data, android.os.Message response)Invokes RIL_REQUEST_OEM_HOOK_RAW on RIL implementation.
|
public void | invokeOemRilRequestStrings(java.lang.String[] strings, android.os.Message response)Invokes RIL_REQUEST_OEM_HOOK_Strings on RIL implementation.
|
public boolean | isDataConnectivityPossible()Report on whether data connectivity is allowed.
|
public void | queryAvailableBandMode(android.os.Message response)Query the list of band mode supported by RF.
|
public void | registerForDisconnect(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 void | registerForIncomingRing(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 void | registerForMmiComplete(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 void | registerForMmiInitiate(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 void | registerForNewRingingConnection(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 void | registerForPhoneStateChanged(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 void | registerForServiceStateChanged(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 void | registerForSuppServiceFailed(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.
|
public void | registerForSuppServiceNotification(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.
|
public void | registerForUnknownConnection(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 void | rejectCall()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()}.
|
public void | selectNetworkManually(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.
|
public void | sendDtmf(char c)Play a DTMF tone on the active call. Ignored if there is no active call.
|
public void | sendUssdResponse(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.
|
public void | setBandMode(int bandMode, android.os.Message response)Assign a specified band for RF configuration.
|
public void | setCallForwardingOption(int commandInterfaceCFReason, int commandInterfaceCFAction, java.lang.String dialingNumber, int timerSeconds, android.os.Message onComplete)setCallForwardingOptions
sets a call forwarding option.
|
public void | setCallWaiting(boolean enable, android.os.Message onComplete)setCallWaiting
sets a call forwarding option.
|
public void | setDataRoamingEnabled(boolean enable)
|
public void | setLine1Number(java.lang.String alphaTag, java.lang.String number, android.os.Message onComplete)Sets the MSISDN phone number in the SIM card.
|
public void | setMute(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.
|
public void | setNetworkSelectionModeAutomatic(android.os.Message response)Switches network selection mode to "automatic", re-scanning and
re-selecting a network if appropriate.
|
public void | setOnPostDialCharacter(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 void | setOutgoingCallerIdDisplay(int commandInterfaceCLIRMode, android.os.Message onComplete)setOutgoingCallerIdDisplay
sets a call forwarding option.
|
public void | setPreferredNetworkType(int networkType, android.os.Message response)Requests to set the preferred network type for searching and registering
(CS/PS domain, RAT, and operation mode)
|
public void | setRadioPower(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.
|
public void | setUnitTestMode(boolean f)For unit tests; don't send notifications to "Phone"
mailbox registrants if true.
|
public void | setVoiceMailNumber(java.lang.String alphaTag, java.lang.String voiceMailNumber, android.os.Message onComplete)setVoiceMailNumber
sets the voicemail number in the SIM card.
|
public void | startDtmf(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.
|
public void | stopDtmf()Stop the playing DTMF tone. Ignored if there is no playing DTMF
tone or no active call.
|
public void | switchHoldingAndActive()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()}.
|
public void | unregisterForDisconnect(android.os.Handler h)Unregisters for voice disconnection notification.
Extraneous calls are tolerated silently
|
public void | unregisterForIncomingRing(android.os.Handler h)Unregisters for ring notification.
Extraneous calls are tolerated silently
|
public void | unregisterForMmiComplete(android.os.Handler h)Unregisters for MMI complete notification.
Extraneous calls are tolerated silently
|
public void | unregisterForMmiInitiate(android.os.Handler h)Unregisters for new MMI initiate notification.
Extraneous calls are tolerated silently
|
public void | unregisterForNewRingingConnection(android.os.Handler h)Unregisters for new ringing connection notification.
Extraneous calls are tolerated silently
|
public void | unregisterForPhoneStateChanged(android.os.Handler h)Unregisters for voice call state change notifications.
Extraneous calls are tolerated silently.
|
public void | unregisterForServiceStateChanged(android.os.Handler h)Unregisters for ServiceStateChange notification.
Extraneous calls are tolerated silently
|
public void | unregisterForSuppServiceFailed(android.os.Handler h)Unregister for notifications when a supplementary service attempt fails.
Extraneous calls are tolerated silently
|
public void | unregisterForSuppServiceNotification(android.os.Handler h)Unregisters for Supplementary Service notifications.
Extraneous calls are tolerated silently
|
public void | unregisterForUnknownConnection(android.os.Handler h)Unregisters for unknown connection notifications.
|
public void | updateServiceLocation(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
|