android.telephony.ServiceState
Contains phone state and service related information.
The following phone information is 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
Summary
Constants
|
|
|
Value |
|
Creator<ServiceState> |
CREATOR |
|
|
|
int |
STATE_EMERGENCY_ONLY |
The phone is registered and locked. Only emergency numbers are allowed. |
2 |
0x00000002 |
int |
STATE_IN_SERVICE |
Normal operation condition, the phone is registered
with an operator either in home network or in roaming. |
0 |
0x00000000 |
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. |
1 |
0x00000001 |
int |
STATE_POWER_OFF |
Radio of telephony is explictly powered off. |
3 |
0x00000003 |
Public Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
public
static
final
int
STATE_EMERGENCY_ONLY
The phone is registered and locked. Only emergency numbers are allowed.
Constant Value:
2
(0x00000002)
public
static
final
int
STATE_IN_SERVICE
Normal operation condition, the phone is registered
with an operator either in home network or in roaming.
Constant Value:
0
(0x00000000)
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.
Constant Value:
1
(0x00000001)
public
static
final
int
STATE_POWER_OFF
Radio of telephony is explictly powered off.
Constant Value:
3
(0x00000003)
Public Constructors
public
ServiceState()
Empty constructor
public
ServiceState(Parcel in)
Construct a ServiceState object from the given parcel.
Public Methods
public
int
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
public
boolean
equals(Object o)
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 (==).
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.
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 or 3 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
(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
public
int
getState()
Get current servcie state of phone
public
int
hashCode()
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.
public
void
setIsManualSelection(boolean isManual)
public
void
setRoaming(boolean roaming)
public
void
setState(int state)
public
void
setStateOff()
public
void
setStateOutOfService()
public
String
toString()
Returns a string containing a concise, human-readable description of the
receiver.
Returns
- String a printable representation for the receiver.
public
void
writeToParcel(Parcel out, int flags)
Flatten this object in to a Parcel.
Protected Methods