Build 1.0_r1(from source)

android.telephony
Class ServiceState

java.lang.Object
  extended by android.telephony.ServiceState
All Implemented Interfaces:
Parcelable

public class ServiceState
extends Object
implements Parcelable

Contains phone state and service related information. The following phone information is included in returned ServiceState:


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.Creator<T>
 
Field Summary
static Parcelable.Creator<ServiceState> CREATOR
           
static int STATE_EMERGENCY_ONLY
          The phone is registered and locked.
static int STATE_IN_SERVICE
          Normal operation condition, the phone is registered with an operator either in home network or in roaming.
static int STATE_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 signal is not available.
static int STATE_POWER_OFF
          Radio of telephony is explictly powered off.
 
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
 
Constructor Summary
ServiceState()
          Empty constructor
ServiceState(Parcel in)
          Construct a ServiceState object from the given parcel.
ServiceState(ServiceState s)
          Copy constructors
 
Method Summary
protected  void copyFrom(ServiceState s)
           
 int describeContents()
          Describe the kinds of special objects contained in this Parcelable's marshalled representation.
 boolean equals(Object o)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 void fillInNotifierBundle(Bundle m)
          Set intent notifier Bundle based on service state
 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 or 3 digit network code The country code can be decoded using MccTable.countryCodeForMcc()
 boolean getRoaming()
          Get current roaming indicator of phone (note: not just decoding from TS 27.007 7.2)
 int getState()
          Get current servcie state of phone
 int hashCode()
          Returns an integer hash code for the receiver.
static ServiceState newFromBundle(Bundle m)
          Create a new ServiceState from a intent notifier Bundle This method is used by PhoneStateIntentReceiver and maybe by external applications.
 void setIsManualSelection(boolean isManual)
           
 void setOperatorName(String longName, String shortName, String numeric)
           
 void setRoaming(boolean roaming)
           
 void setState(int state)
           
 void setStateOff()
           
 void setStateOutOfService()
           
 String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 void writeToParcel(Parcel out, int flags)
          Flatten this object in to a Parcel.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_IN_SERVICE

public static final int STATE_IN_SERVICE
Normal operation condition, the phone is registered with an operator either in home network or in roaming.

See Also:
Constant Field Values

STATE_OUT_OF_SERVICE

public static final int STATE_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 signal is not available.

See Also:
Constant Field Values

STATE_EMERGENCY_ONLY

public static final int STATE_EMERGENCY_ONLY
The phone is registered and locked. Only emergency numbers are allowed.

See Also:
Constant Field Values

STATE_POWER_OFF

public static final int STATE_POWER_OFF
Radio of telephony is explictly powered off.

See Also:
Constant Field Values

CREATOR

public static final Parcelable.Creator<ServiceState> CREATOR
Constructor Detail

ServiceState

public ServiceState()
Empty constructor


ServiceState

public ServiceState(ServiceState s)
Copy constructors

Parameters:
s - Source service state

ServiceState

public ServiceState(Parcel in)
Construct a ServiceState object from the given parcel.

Method Detail

newFromBundle

public static ServiceState newFromBundle(Bundle m)
Create a new ServiceState from a intent notifier Bundle This method is used by PhoneStateIntentReceiver and maybe by external applications.

Parameters:
m - Bundle from intent notifier
Returns:
newly created ServiceState

copyFrom

protected void copyFrom(ServiceState s)

writeToParcel

public void writeToParcel(Parcel out,
                          int flags)
Description copied from interface: Parcelable
Flatten this object in to a Parcel.

Specified by:
writeToParcel in interface Parcelable
Parameters:
out - The Parcel in which the object should be written.
flags - Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.

describeContents

public int describeContents()
Description copied from interface: Parcelable
Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Specified by:
describeContents in interface Parcelable
Returns:
a bitmask indicating the set of special object types marshalled by the Parcelable.

getState

public int getState()
Get current servcie state of phone

See Also:
STATE_IN_SERVICE, STATE_OUT_OF_SERVICE, STATE_EMERGENCY_ONLY, STATE_POWER_OFF

getRoaming

public boolean getRoaming()
Get current roaming indicator of phone (note: not just decoding from TS 27.007 7.2)

Returns:
true if TS 27.007 7.2 roaming is true and ONS is different from SPN

getOperatorAlphaLong

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

getOperatorAlphaShort

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

getOperatorNumeric

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

Returns:
numeric format of operator, null if unregistered or unknown

getIsManualSelection

public boolean getIsManualSelection()
Get current network selection mode

Returns:
true if manual mode, false if automatic mode

hashCode

public int hashCode()
Description copied from class: Object
Returns 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.

Overrides:
hashCode in class Object
Returns:
int the receiver's hash.
See Also:
Object.equals(java.lang.Object)

equals

public boolean equals(Object o)
Description copied from class: Object
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Overrides:
equals in class Object
Parameters:
o - Object the object to compare with this object.
Returns:
boolean true if the object is the same as this object false if it is different from this object.
See Also:
Object.hashCode()

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

setStateOutOfService

public void setStateOutOfService()

setStateOff

public void setStateOff()

setState

public void setState(int state)

setRoaming

public void setRoaming(boolean roaming)

setOperatorName

public void setOperatorName(String longName,
                            String shortName,
                            String numeric)

setIsManualSelection

public void setIsManualSelection(boolean isManual)

fillInNotifierBundle

public void fillInNotifierBundle(Bundle m)
Set intent notifier Bundle based on service state

Parameters:
m - intent notifier Bundle

Build 1.0_r1(from source)

Please submit a feedback, bug or feature