Fields Summary |
---|
public static final int | STATE_IN_SERVICENormal operation condition, the phone is registered
with an operator either in home network or in roaming. |
public static final int | STATE_OUT_OF_SERVICEPhone 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. |
public static final int | STATE_EMERGENCY_ONLYThe phone is registered and locked. Only emergency numbers are allowed. {@more} |
public static final int | STATE_POWER_OFFRadio of telephony is explictly powered off. |
private int | mState |
private boolean | mRoaming |
private String | mOperatorAlphaLong |
private String | mOperatorAlphaShort |
private String | mOperatorNumeric |
private boolean | mIsManualNetworkSelection |
public static final Parcelable.Creator | CREATOR |
Methods Summary |
---|
protected void | copyFrom(android.telephony.ServiceState s)
mState = s.mState;
mRoaming = s.mRoaming;
mOperatorAlphaLong = s.mOperatorAlphaLong;
mOperatorAlphaShort = s.mOperatorAlphaShort;
mOperatorNumeric = s.mOperatorNumeric;
mIsManualNetworkSelection = s.mIsManualNetworkSelection;
|
public int | describeContents()
return 0;
|
public boolean | equals(java.lang.Object o)
ServiceState s;
try {
s = (ServiceState) o;
} catch (ClassCastException ex) {
return false;
}
if (o == null) {
return false;
}
return mState == s.mState
&& mRoaming == s.mRoaming
&& mIsManualNetworkSelection == s.mIsManualNetworkSelection
&& equalsHandlesNulls(mOperatorAlphaLong, s.mOperatorAlphaLong)
&& equalsHandlesNulls(mOperatorAlphaShort, s.mOperatorAlphaShort)
&& equalsHandlesNulls(mOperatorNumeric, s.mOperatorNumeric);
|
private static boolean | equalsHandlesNulls(java.lang.Object a, java.lang.Object b)Test whether two objects hold the same data values or both are null
return (a == null) ? (b == null) : a.equals (b);
|
public void | fillInNotifierBundle(android.os.Bundle m)Set intent notifier Bundle based on service state
m.putInt("state", mState);
m.putBoolean("roaming", Boolean.valueOf(mRoaming));
m.putString("operator-alpha-long", mOperatorAlphaLong);
m.putString("operator-alpha-short", mOperatorAlphaShort);
m.putString("operator-numeric", mOperatorNumeric);
m.putBoolean("manual", Boolean.valueOf(mIsManualNetworkSelection));
|
public boolean | getIsManualSelection()Get current network selection mode
return mIsManualNetworkSelection;
|
public java.lang.String | getOperatorAlphaLong()Get current registered operator name in long alphanumeric format
In GSM/UMTS, long format can be upto 16 characters long
return mOperatorAlphaLong;
|
public java.lang.String | getOperatorAlphaShort()Get current registered operator name in short lphanumeric format
In GSM/UMST, short format can be upto 8 characters long
return mOperatorAlphaShort;
|
public java.lang.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()
return mOperatorNumeric;
|
public boolean | getRoaming()Get current roaming indicator of phone
(note: not just decoding from TS 27.007 7.2)
return mRoaming;
|
public int | getState()Get current servcie state of phone
return mState;
|
public int | hashCode()
return (mState * 0x1234)
+ (mRoaming ? 1 : 0)
+ (mIsManualNetworkSelection ? 1 : 0)
+ ((null == mOperatorAlphaLong) ? 0 : mOperatorAlphaLong.hashCode())
+ ((null == mOperatorAlphaShort) ? 0 : mOperatorAlphaShort.hashCode())
+ ((null == mOperatorNumeric) ? 0 : mOperatorNumeric.hashCode());
|
public static android.telephony.ServiceState | newFromBundle(android.os.Bundle m)Create a new ServiceState from a intent notifier Bundle
This method is used by PhoneStateIntentReceiver and maybe by
external applications.
ServiceState ret;
ret = new ServiceState();
ret.setFromNotifierBundle(m);
return ret;
|
private void | setFromNotifierBundle(android.os.Bundle m)Set ServiceState based on intent notifier map
mState = m.getInt("state");
mRoaming = m.getBoolean("roaming");
mOperatorAlphaLong = m.getString("operator-alpha-long");
mOperatorAlphaShort = m.getString("operator-alpha-short");
mOperatorNumeric = m.getString("operator-numeric");
mIsManualNetworkSelection = m.getBoolean("manual");
|
public void | setIsManualSelection(boolean isManual)
mIsManualNetworkSelection = isManual;
|
public void | setOperatorName(java.lang.String longName, java.lang.String shortName, java.lang.String numeric)
mOperatorAlphaLong = longName;
mOperatorAlphaShort = shortName;
mOperatorNumeric = numeric;
|
public void | setRoaming(boolean roaming)
mRoaming = roaming;
|
public void | setState(int state)
mState = state;
|
public void | setStateOff()
mState = STATE_POWER_OFF;
mRoaming = false;
mOperatorAlphaLong = null;
mOperatorAlphaShort = null;
mOperatorNumeric = null;
mIsManualNetworkSelection = false;
|
public void | setStateOutOfService()
mState = STATE_OUT_OF_SERVICE;
mRoaming = false;
mOperatorAlphaLong = null;
mOperatorAlphaShort = null;
mOperatorNumeric = null;
mIsManualNetworkSelection = false;
|
public java.lang.String | toString()
return mState + " " + (mRoaming ? "roaming" : "home")
+ " " + mOperatorAlphaLong
+ " " + mOperatorAlphaShort
+ " " + mOperatorNumeric
+ " " + (mIsManualNetworkSelection ? "(manual)" : "");
|
public void | writeToParcel(android.os.Parcel out, int flags)
out.writeInt(mState);
out.writeInt(mRoaming ? 1 : 0);
out.writeString(mOperatorAlphaLong);
out.writeString(mOperatorAlphaShort);
out.writeString(mOperatorNumeric);
out.writeInt(mIsManualNetworkSelection ? 1 : 0);
|