English | Site Directory

Android - An Open Handset Alliance Project

android.telephony
public class

android.telephony.ServiceState

java.lang.Object
android.telephony.ServiceState

ServcieState class contains phone state and service related information for applications other than phone app to use. Intent registration is the prefered way for other than phone applications to access phone information. Applications should register for SERVICE_STATE_CHANGED_ACTION intent first then calling getServiceState() to get an instatnce of ServiceState of default phone. Following phone information are included in returned ServiceState Service state: IN_SERVICE, OUT_OF_SERVICE, EMERGENCY_ONLY, POWER_OFF Roaming indicator Operator name, short name and numeric id Network selection mode

Nested Classes
ServiceState.State The servcie state enums of phone. 

Summary

Fields

protected      int  mCid   
protected      boolean  mIsManualNetworkSelection   
protected      int  mLac   
protected      String  mOperatorAlphaLong   
protected      String  mOperatorAlphaShort   
protected      String  mOperatorNumeric   
protected      Phone  mPhone   
protected      boolean  mRoaming   
protected      State  mState   

Public Methods

        boolean  equals(Object o)
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
        boolean  getIsManualSelection()
Get current network selection mode
        String  getOperatorAlphaLong()
Get current registered operator name in long alphanumeric format In GSM/UMTS, long format can be upto 16 characters long
        String  getOperatorAlphaShort()
Get current registered operator name in short lphanumeric format In GSM/UMST, short format can be upto 8 characters long
        String  getOperatorNumeric()
Get current registered operator numeric id In GSM/UMTS, numeric format is 3 digit country code plus 2 digit network code The country code can be decoded using MccTable.countryCodeForMcc()
        boolean  getRoaming()
Get current roaming indicator of phone, decoding from TS 27.007 7.2
        State  getState()
Get current servcie state of phone
        int  hashCode()
Answers an integer hash code for the receiver.
      static  void  requestStateUpdate()
Force update of LAC and CID in ServiceState to indicate phone location.
        String  toString()
Answers a string containing a concise, human-readable description of the receiver.

Protected Methods

        void  copyFrom(ServiceState s)
Methods inherited from class java.lang.Object

Details

Fields

protected int mCid

protected boolean mIsManualNetworkSelection

protected int mLac

protected String mOperatorAlphaLong

protected String mOperatorAlphaShort

protected String mOperatorNumeric

protected Phone mPhone

protected boolean mRoaming

protected State mState

Public Methods

public boolean equals(Object o)

Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. The implementation in Object answers true only if the argument is the exact same object as the receiver (==).

Parameters

o Object the object to compare with this object.

public boolean getIsManualSelection()

Get current network selection mode

Returns

  • true if manual mode, false if automatic mode

public String getOperatorAlphaLong()

Get current registered operator name in long alphanumeric format In GSM/UMTS, long format can be upto 16 characters long

Returns

  • long name of operator, null if unregistered or unknown

public String getOperatorAlphaShort()

Get current registered operator name in short lphanumeric format In GSM/UMST, short format can be upto 8 characters long

Returns

  • short name of operator, null if unregistered or unknown

public String getOperatorNumeric()

Get current registered operator numeric id In GSM/UMTS, numeric format is 3 digit country code plus 2 digit network code The country code can be decoded using MccTable.countryCodeForMcc()

Returns

  • numeric format of operator, null if unregistered or unknown

public boolean getRoaming()

Get current roaming indicator of phone, decoding from TS 27.007 7.2

Returns

  • true if phone is in registered roaming, false otherwise

public State getState()

Get current servcie state of phone

Returns

  • a servcie state enums of phone. The value is one of the following IN_SERVICE = Normal operation condition, the phone is registered with an operator either in home network or in roaming. OUT_OF_SERVICE = Phone is not registered with any operator, the phone can be currently searching a new operator to register to, or not searching to registration at all, or registration is denied, or radio is not available. EMERGENCY_ONLY = The phone is registered and locked. Only emergency number are allowed. POWER_OFF = Radio of telephony is explictly powered off.

public int hashCode()

Answers an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.

public static void requestStateUpdate()

Force update of LAC and CID in ServiceState to indicate phone location. If get different LAC and/or CID, notifyServiceState will be sent

public String toString()

Answers a string containing a concise, human-readable description of the receiver.

Protected Methods

protected void copyFrom(ServiceState s)

Build m5-rc15i - 10 Jun 2008 13:54