com.googlecode.android_scripting.facade
Class PhoneFacade

java.lang.Object
  extended by com.googlecode.android_scripting.jsonrpc.RpcReceiver
      extended by com.googlecode.android_scripting.facade.PhoneFacade

public class PhoneFacade
extends RpcReceiver

Exposes TelephonyManager functionality.

Author:
Damon Kohler (damonkohler@gmail.com), Felix Arends (felix.arends@gmail.com)

Constructor Summary
PhoneFacade(FacadeManager manager)
           
 
Method Summary
 java.lang.Boolean checkNetworkRoaming()
           
 CellLocation getCellLocation()
           
 java.lang.String getDeviceId()
           
 java.lang.String getDeviceSoftwareVersion()
           
 java.lang.String getLine1Number()
           
 java.util.List<NeighboringCellInfo> getNeighboringCellInfo()
           
 java.lang.String getNetworkOperator()
           
 java.lang.String getNetworkOperatorName()
           
 java.lang.String getNetworkType()
           
 java.lang.String getPhoneType()
           
 java.lang.String getSimCountryIso()
           
 java.lang.String getSimOperator()
           
 java.lang.String getSimOperatorName()
           
 java.lang.String getSimSerialNumber()
           
 java.lang.String getSimState()
           
 java.lang.String getSubscriberId()
           
 java.lang.String getVoiceMailAlphaTag()
           
 java.lang.String getVoiceMailNumber()
           
 void phoneCall(java.lang.String uriString)
           
 void phoneCallNumber(java.lang.String number)
           
 void phoneDial(java.lang.String uri)
           
 void phoneDialNumber(java.lang.String number)
           
 Bundle readPhoneState()
           
 void shutdown()
          Invoked when the receiver is shut down.
 void startTrackingPhoneState()
           
 void stopTrackingPhoneState()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhoneFacade

public PhoneFacade(FacadeManager manager)
Method Detail

shutdown

public void shutdown()
Description copied from class: RpcReceiver
Invoked when the receiver is shut down.

Specified by:
shutdown in class RpcReceiver

startTrackingPhoneState

@Rpc(description="Starts tracking phone state.")
@RpcStartEvent(value="phone")
public void startTrackingPhoneState()

readPhoneState

@Rpc(description="Returns the current phone state and incoming number.",
     returns="A Map of \"state\" and \"incomingNumber\"")
public Bundle readPhoneState()

stopTrackingPhoneState

@Rpc(description="Stops tracking phone state.")
@RpcStopEvent(value="phone")
public void stopTrackingPhoneState()

phoneCall

@Rpc(description="Calls a contact/phone number by URI.")
public void phoneCall(@RpcParameter(name="uri")
                                     java.lang.String uriString)
               throws java.lang.Exception
Throws:
java.lang.Exception

phoneCallNumber

@Rpc(description="Calls a phone number.")
public void phoneCallNumber(@RpcParameter(name="phone number")
                                           java.lang.String number)
                     throws java.lang.Exception
Throws:
java.lang.Exception

phoneDial

@Rpc(description="Dials a contact/phone number by URI.")
public void phoneDial(@RpcParameter(name="uri")
                                     java.lang.String uri)
               throws java.lang.Exception
Throws:
java.lang.Exception

phoneDialNumber

@Rpc(description="Dials a phone number.")
public void phoneDialNumber(@RpcParameter(name="phone number")
                                           java.lang.String number)
                     throws java.lang.Exception,
                            java.io.UnsupportedEncodingException
Throws:
java.lang.Exception
java.io.UnsupportedEncodingException

getCellLocation

@Rpc(description="Returns the current cell location.")
public CellLocation getCellLocation()

getNetworkOperator

@Rpc(description="Returns the numeric name (MCC+MNC) of current registered operator.")
public java.lang.String getNetworkOperator()

getNetworkOperatorName

@Rpc(description="Returns the alphabetic name of current registered operator.")
public java.lang.String getNetworkOperatorName()

getNetworkType

@Rpc(description="Returns a the radio technology (network type) currently in use on the device.")
public java.lang.String getNetworkType()

getPhoneType

@Rpc(description="Returns the device phone type.")
public java.lang.String getPhoneType()

getSimCountryIso

@Rpc(description="Returns the ISO country code equivalent for the SIM provider\'s country code.")
public java.lang.String getSimCountryIso()

getSimOperator

@Rpc(description="Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. 5 or 6 decimal digits.")
public java.lang.String getSimOperator()

getSimOperatorName

@Rpc(description="Returns the Service Provider Name (SPN).")
public java.lang.String getSimOperatorName()

getSimSerialNumber

@Rpc(description="Returns the serial number of the SIM, if applicable. Return null if it is unavailable.")
public java.lang.String getSimSerialNumber()

getSimState

@Rpc(description="Returns the state of the device SIM card.")
public java.lang.String getSimState()

getSubscriberId

@Rpc(description="Returns the unique subscriber ID, for example, the IMSI for a GSM phone. Return null if it is unavailable.")
public java.lang.String getSubscriberId()

getVoiceMailAlphaTag

@Rpc(description="Retrieves the alphabetic identifier associated with the voice mail number.")
public java.lang.String getVoiceMailAlphaTag()

getVoiceMailNumber

@Rpc(description="Returns the voice mail number. Return null if it is unavailable.")
public java.lang.String getVoiceMailNumber()

checkNetworkRoaming

@Rpc(description="Returns true if the device is considered roaming on the current network, for GSM purposes.")
public java.lang.Boolean checkNetworkRoaming()

getDeviceId

@Rpc(description="Returns the unique device ID, for example, the IMEI for GSM and the MEID for CDMA phones. Return null if device ID is not available.")
public java.lang.String getDeviceId()

getDeviceSoftwareVersion

@Rpc(description="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.")
public java.lang.String getDeviceSoftwareVersion()

getLine1Number

@Rpc(description="Returns the phone number string for line 1, for example, the MSISDN for a GSM phone. Return null if it is unavailable.")
public java.lang.String getLine1Number()

getNeighboringCellInfo

@Rpc(description="Returns the neighboring cell information of the device.")
public java.util.List<NeighboringCellInfo> getNeighboringCellInfo()