English | Site Directory

Android - An Open Handset Alliance Project

android.telephony
public interface

android.telephony.IPhone

android.telephony.IPhone IInterface

Interface for SDK developers to use to control the phone.

The following code snippet demonstrates a static method to retrieve the IPhone interface from Android:

private static IPhone getPhoneInterface() throws DeadObjectException {
    IServiceManager sm = ServiceManagerNative.getDefault();
    IPhone phoneService = IPhone.Stub.asInterface(sm.getService("phone"));
    return phoneService;
}
 

Nested Classes
IPhone.Stub Local-side IPC implementation stub class. 
Known Indirect Subclasses

Summary

Public Methods

        boolean  authenticateWithPin(String pin)
Authenticate against the SIM pin.
        void  call(String number)
Place a call to the numer.
        void  dial(String number)
Dial a number.
        void  endCall(boolean hangupOnly)
End call or go to the Home screen
        boolean  isOffhook()
Check if we are in either an active or holding call
        boolean  isRadioOn()
Check to see if the radio is on or not.
        boolean  isSimPinEnabled()
Check if the SIM pin lock is enabled.
        void  toggleRadioOnOff()
Toggles the radio on or off.
        void  updateServiceLocation()
Reqeust to update location information in service state
Methods inherited from interface android.os.IInterface

Details

Public Methods

public boolean authenticateWithPin(String pin)

Authenticate against the SIM pin. This doesn't actually authenticate against the SIM card, but rather compares against the SIM pin stored in memory (if any).

Returns

  • true if the pin supplied matches the SIM pin stored in memory.

public void call(String number)

Place a call to the numer.

Parameters

number the number to be called.

public void dial(String number)

Dial a number. This doesn't place the call. It displays the Dialer screen.

Parameters

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

public void endCall(boolean hangupOnly)

End call or go to the Home screen

public boolean isOffhook()

Check if we are in either an active or holding call

Returns

  • true if the phone state is offhook.

public boolean isRadioOn()

Check to see if the radio is on or not.

Returns

  • returns true if the radio is on.

public boolean isSimPinEnabled()

Check if the SIM pin lock is enabled.

Returns

  • true if the SIM pin lock is enabled.

public void toggleRadioOnOff()

Toggles the radio on or off.

public void updateServiceLocation()

Reqeust to update location information in service state
Build m5-rc15i - 10 Jun 2008 13:54