FileDocCategorySizeDatePackage
ServiceState.javaAPI DocAndroid 5.1 API37622Thu Mar 12 22:22:42 GMT 2015android.telephony

ServiceState

public class ServiceState extends Object implements android.os.Parcelable
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

Fields Summary
static final String
LOG_TAG
static final boolean
DBG
public static final int
STATE_IN_SERVICE
Normal operation condition, the phone is registered with an operator either in home network or in roaming.
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.
public static final int
STATE_EMERGENCY_ONLY
The phone is registered and locked. Only emergency numbers are allowed. {@more}
public static final int
STATE_POWER_OFF
Radio of telephony is explicitly powered off.
public static final int
RIL_REG_STATE_NOT_REG
RIL level registration state values from ril.h ((const char **)response)[0] is registration state 0-6, 0 - Not registered, MT is not currently searching a new operator to register 1 - Registered, home network 2 - Not registered, but MT is currently searching a new operator to register 3 - Registration denied 4 - Unknown 5 - Registered, roaming 10 - Same as 0, but indicates that emergency calls are enabled. 12 - Same as 2, but indicates that emergency calls are enabled. 13 - Same as 3, but indicates that emergency calls are enabled. 14 - Same as 4, but indicates that emergency calls are enabled.
public static final int
RIL_REG_STATE_HOME
public static final int
RIL_REG_STATE_SEARCHING
public static final int
RIL_REG_STATE_DENIED
public static final int
RIL_REG_STATE_UNKNOWN
public static final int
RIL_REG_STATE_ROAMING
public static final int
RIL_REG_STATE_NOT_REG_EMERGENCY_CALL_ENABLED
public static final int
RIL_REG_STATE_SEARCHING_EMERGENCY_CALL_ENABLED
public static final int
RIL_REG_STATE_DENIED_EMERGENCY_CALL_ENABLED
public static final int
RIL_REG_STATE_UNKNOWN_EMERGENCY_CALL_ENABLED
public static final int
RIL_RADIO_TECHNOLOGY_UNKNOWN
public static final int
RIL_RADIO_TECHNOLOGY_GPRS
public static final int
RIL_RADIO_TECHNOLOGY_EDGE
public static final int
RIL_RADIO_TECHNOLOGY_UMTS
public static final int
RIL_RADIO_TECHNOLOGY_IS95A
public static final int
RIL_RADIO_TECHNOLOGY_IS95B
public static final int
RIL_RADIO_TECHNOLOGY_1xRTT
public static final int
RIL_RADIO_TECHNOLOGY_EVDO_0
public static final int
RIL_RADIO_TECHNOLOGY_EVDO_A
public static final int
RIL_RADIO_TECHNOLOGY_HSDPA
public static final int
RIL_RADIO_TECHNOLOGY_HSUPA
public static final int
RIL_RADIO_TECHNOLOGY_HSPA
public static final int
RIL_RADIO_TECHNOLOGY_EVDO_B
public static final int
RIL_RADIO_TECHNOLOGY_EHRPD
public static final int
RIL_RADIO_TECHNOLOGY_LTE
public static final int
RIL_RADIO_TECHNOLOGY_HSPAP
public static final int
RIL_RADIO_TECHNOLOGY_GSM
GSM radio technology only supports voice. It does not support data.
public static final int
RIL_RADIO_TECHNOLOGY_TD_SCDMA
public static final int
REGISTRATION_STATE_NOT_REGISTERED_AND_NOT_SEARCHING
public static final int
REGISTRATION_STATE_HOME_NETWORK
public static final int
REGISTRATION_STATE_NOT_REGISTERED_AND_SEARCHING
public static final int
REGISTRATION_STATE_REGISTRATION_DENIED
public static final int
REGISTRATION_STATE_UNKNOWN
public static final int
REGISTRATION_STATE_ROAMING
private int
mVoiceRegState
private int
mDataRegState
public static final int
ROAMING_TYPE_NOT_ROAMING
Roaming type HOME : in home network
public static final int
ROAMING_TYPE_UNKNOWN
Roaming type UNKNOWN : in a roaming network, but we can not tell if it's domestic or international
public static final int
ROAMING_TYPE_DOMESTIC
Roaming type DOMESTIC : in domestic roaming network
public static final int
ROAMING_TYPE_INTERNATIONAL
Roaming type INTERNATIONAL : in international roaming network
private int
mVoiceRoamingType
private int
mDataRoamingType
private String
mVoiceOperatorAlphaLong
private String
mVoiceOperatorAlphaShort
private String
mVoiceOperatorNumeric
private String
mDataOperatorAlphaLong
private String
mDataOperatorAlphaShort
private String
mDataOperatorNumeric
private boolean
mIsManualNetworkSelection
private boolean
mIsEmergencyOnly
private int
mRilVoiceRadioTechnology
private int
mRilDataRadioTechnology
private boolean
mCssIndicator
private int
mNetworkId
private int
mSystemId
private int
mCdmaRoamingIndicator
private int
mCdmaDefaultRoamingIndicator
private int
mCdmaEriIconIndex
private int
mCdmaEriIconMode
public static final Parcelable.Creator
CREATOR
Constructors Summary
public ServiceState()
Empty constructor

    
public ServiceState(ServiceState s)
Copy constructors

param
s Source service state

        copyFrom(s);
    
public ServiceState(android.os.Parcel in)
Construct a ServiceState object from the given parcel.

        mVoiceRegState = in.readInt();
        mDataRegState = in.readInt();
        mVoiceRoamingType = in.readInt();
        mDataRoamingType = in.readInt();
        mVoiceOperatorAlphaLong = in.readString();
        mVoiceOperatorAlphaShort = in.readString();
        mVoiceOperatorNumeric = in.readString();
        mDataOperatorAlphaLong = in.readString();
        mDataOperatorAlphaShort = in.readString();
        mDataOperatorNumeric = in.readString();
        mIsManualNetworkSelection = in.readInt() != 0;
        mRilVoiceRadioTechnology = in.readInt();
        mRilDataRadioTechnology = in.readInt();
        mCssIndicator = (in.readInt() != 0);
        mNetworkId = in.readInt();
        mSystemId = in.readInt();
        mCdmaRoamingIndicator = in.readInt();
        mCdmaDefaultRoamingIndicator = in.readInt();
        mCdmaEriIconIndex = in.readInt();
        mCdmaEriIconMode = in.readInt();
        mIsEmergencyOnly = in.readInt() != 0;
    
Methods Summary
protected voidcopyFrom(android.telephony.ServiceState s)

        mVoiceRegState = s.mVoiceRegState;
        mDataRegState = s.mDataRegState;
        mVoiceRoamingType = s.mVoiceRoamingType;
        mDataRoamingType = s.mDataRoamingType;
        mVoiceOperatorAlphaLong = s.mVoiceOperatorAlphaLong;
        mVoiceOperatorAlphaShort = s.mVoiceOperatorAlphaShort;
        mVoiceOperatorNumeric = s.mVoiceOperatorNumeric;
        mDataOperatorAlphaLong = s.mDataOperatorAlphaLong;
        mDataOperatorAlphaShort = s.mDataOperatorAlphaShort;
        mDataOperatorNumeric = s.mDataOperatorNumeric;
        mIsManualNetworkSelection = s.mIsManualNetworkSelection;
        mRilVoiceRadioTechnology = s.mRilVoiceRadioTechnology;
        mRilDataRadioTechnology = s.mRilDataRadioTechnology;
        mCssIndicator = s.mCssIndicator;
        mNetworkId = s.mNetworkId;
        mSystemId = s.mSystemId;
        mCdmaRoamingIndicator = s.mCdmaRoamingIndicator;
        mCdmaDefaultRoamingIndicator = s.mCdmaDefaultRoamingIndicator;
        mCdmaEriIconIndex = s.mCdmaEriIconIndex;
        mCdmaEriIconMode = s.mCdmaEriIconMode;
        mIsEmergencyOnly = s.mIsEmergencyOnly;
    
public intdescribeContents()

        return 0;
    
public booleanequals(java.lang.Object o)

        ServiceState s;

        try {
            s = (ServiceState) o;
        } catch (ClassCastException ex) {
            return false;
        }

        if (o == null) {
            return false;
        }

        return (mVoiceRegState == s.mVoiceRegState
                && mDataRegState == s.mDataRegState
                && mIsManualNetworkSelection == s.mIsManualNetworkSelection
                && mVoiceRoamingType == s.mVoiceRoamingType
                && mDataRoamingType == s.mDataRoamingType
                && equalsHandlesNulls(mVoiceOperatorAlphaLong, s.mVoiceOperatorAlphaLong)
                && equalsHandlesNulls(mVoiceOperatorAlphaShort, s.mVoiceOperatorAlphaShort)
                && equalsHandlesNulls(mVoiceOperatorNumeric, s.mVoiceOperatorNumeric)
                && equalsHandlesNulls(mDataOperatorAlphaLong, s.mDataOperatorAlphaLong)
                && equalsHandlesNulls(mDataOperatorAlphaShort, s.mDataOperatorAlphaShort)
                && equalsHandlesNulls(mDataOperatorNumeric, s.mDataOperatorNumeric)
                && equalsHandlesNulls(mRilVoiceRadioTechnology, s.mRilVoiceRadioTechnology)
                && equalsHandlesNulls(mRilDataRadioTechnology, s.mRilDataRadioTechnology)
                && equalsHandlesNulls(mCssIndicator, s.mCssIndicator)
                && equalsHandlesNulls(mNetworkId, s.mNetworkId)
                && equalsHandlesNulls(mSystemId, s.mSystemId)
                && equalsHandlesNulls(mCdmaRoamingIndicator, s.mCdmaRoamingIndicator)
                && equalsHandlesNulls(mCdmaDefaultRoamingIndicator,
                        s.mCdmaDefaultRoamingIndicator)
                && mIsEmergencyOnly == s.mIsEmergencyOnly);
    
private static booleanequalsHandlesNulls(java.lang.Object a, java.lang.Object b)
Test whether two objects hold the same data values or both are null.

param
a first obj
param
b second obj
return
true if two objects equal or both are null

        return (a == null) ? (b == null) : a.equals (b);
    
public voidfillInNotifierBundle(android.os.Bundle m)
Set intent notifier Bundle based on service state.

param
m intent notifier Bundle
hide

        m.putInt("voiceRegState", mVoiceRegState);
        m.putInt("dataRegState", mDataRegState);
        m.putInt("voiceRoamingType", mVoiceRoamingType);
        m.putInt("dataRoamingType", mDataRoamingType);
        m.putString("operator-alpha-long", mVoiceOperatorAlphaLong);
        m.putString("operator-alpha-short", mVoiceOperatorAlphaShort);
        m.putString("operator-numeric", mVoiceOperatorNumeric);
        m.putString("data-operator-alpha-long", mDataOperatorAlphaLong);
        m.putString("data-operator-alpha-short", mDataOperatorAlphaShort);
        m.putString("data-operator-numeric", mDataOperatorNumeric);
        m.putBoolean("manual", Boolean.valueOf(mIsManualNetworkSelection));
        m.putInt("radioTechnology", mRilVoiceRadioTechnology);
        m.putInt("dataRadioTechnology", mRilDataRadioTechnology);
        m.putBoolean("cssIndicator", mCssIndicator);
        m.putInt("networkId", mNetworkId);
        m.putInt("systemId", mSystemId);
        m.putInt("cdmaRoamingIndicator", mCdmaRoamingIndicator);
        m.putInt("cdmaDefaultRoamingIndicator", mCdmaDefaultRoamingIndicator);
        m.putBoolean("emergencyOnly", Boolean.valueOf(mIsEmergencyOnly));
    
public intgetCdmaDefaultRoamingIndicator()

hide

        return this.mCdmaDefaultRoamingIndicator;
    
public intgetCdmaEriIconIndex()

hide

        return this.mCdmaEriIconIndex;
    
public intgetCdmaEriIconMode()

hide

        return this.mCdmaEriIconMode;
    
public intgetCdmaRoamingIndicator()

hide

        return this.mCdmaRoamingIndicator;
    
public intgetCssIndicator()

hide

        return this.mCssIndicator ? 1 : 0;
    
public intgetDataNetworkType()

hide

        return rilRadioTechnologyToNetworkType(mRilDataRadioTechnology);
    
public java.lang.StringgetDataOperatorAlphaLong()
Get current registered data network operator name in long alphanumeric format.

return
long name of voice operator
hide

        return mDataOperatorAlphaLong;
    
public java.lang.StringgetDataOperatorAlphaShort()
Get current registered data network operator name in short alphanumeric format.

return
short name of operator, null if unregistered or unknown
hide

        return mDataOperatorAlphaShort;
    
public java.lang.StringgetDataOperatorNumeric()
Get current registered data network operator numeric id.

return
numeric format of operator, null if unregistered or unknown
hide

        return mDataOperatorNumeric;
    
public intgetDataRegState()
Get current data service state

see
#STATE_IN_SERVICE
see
#STATE_OUT_OF_SERVICE
see
#STATE_EMERGENCY_ONLY
see
#STATE_POWER_OFF
hide

        return mDataRegState;
    
public booleangetDataRoaming()
Get current data network roaming type

return
roaming type
hide

        return mDataRoamingType != ROAMING_TYPE_NOT_ROAMING;
    
public intgetDataRoamingType()
Get current data network roaming type

return
roaming type
hide

        return mDataRoamingType;
    
public booleangetIsManualSelection()
Get current network selection mode.

return
true if manual mode, false if automatic mode

        return mIsManualNetworkSelection;
    
public intgetNetworkId()

hide

        return this.mNetworkId;
    
public intgetNetworkType()

Deprecated
to be removed Q3 2013 use {@link #getVoiceNetworkType}
hide

        Rlog.e(LOG_TAG, "ServiceState.getNetworkType() DEPRECATED will be removed *******");
        return rilRadioTechnologyToNetworkType(mRilVoiceRadioTechnology);
    
public java.lang.StringgetOperatorAlphaLong()
Get current registered operator name in long alphanumeric format. In GSM/UMTS, long format can be up to 16 characters long. In CDMA, returns the ERI text, if set. Otherwise, returns the ONS.

return
long name of operator, null if unregistered or unknown

        return mVoiceOperatorAlphaLong;
    
public java.lang.StringgetOperatorAlphaShort()
Get current registered operator name in short alphanumeric format. In GSM/UMTS, short format can be up to 8 characters long.

return
short name of operator, null if unregistered or unknown

        return mVoiceOperatorAlphaShort;
    
public java.lang.StringgetOperatorNumeric()
Get current registered operator numeric id. In GSM/UMTS, numeric format is 3 digit country code plus 2 or 3 digit network code.

return
numeric format of operator, null if unregistered or unknown

        return mVoiceOperatorNumeric;
    
public intgetRadioTechnology()

hide
Deprecated
to be removed Q3 2013 use {@link #getRilDataRadioTechnology} or {@link #getRilVoiceRadioTechnology}

        Rlog.e(LOG_TAG, "ServiceState.getRadioTechnology() DEPRECATED will be removed *******");
        return getRilDataRadioTechnology();
    
public intgetRilDataRadioTechnology()

hide

        return this.mRilDataRadioTechnology;
    
public intgetRilVoiceRadioTechnology()

hide

        return this.mRilVoiceRadioTechnology;
    
public booleangetRoaming()
Get current roaming indicator of phone (note: not just decoding from TS 27.007 7.2)

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

        return getVoiceRoaming() || getDataRoaming();
    
public static final java.lang.StringgetRoamingLogString(int roamingType)
get String description of roaming type

hide


                
          
        switch (roamingType) {
            case ROAMING_TYPE_NOT_ROAMING:
                return "home";

            case ROAMING_TYPE_UNKNOWN:
                return "roaming";

            case ROAMING_TYPE_DOMESTIC:
                return "Domestic Roaming";

            case ROAMING_TYPE_INTERNATIONAL:
                return "International Roaming";

            default:
                return "UNKNOWN";
        }
    
public intgetState()
Get current voice service state


              
       
        return getVoiceRegState();
    
public intgetSystemId()

hide

        return this.mSystemId;
    
public intgetVoiceNetworkType()

hide

        return rilRadioTechnologyToNetworkType(mRilVoiceRadioTechnology);
    
public java.lang.StringgetVoiceOperatorAlphaLong()
Get current registered voice network operator name in long alphanumeric format.

return
long name of operator
hide

        return mVoiceOperatorAlphaLong;
    
public java.lang.StringgetVoiceOperatorAlphaShort()
Get current registered voice network operator name in short alphanumeric format.

return
short name of operator, null if unregistered or unknown
hide

        return mVoiceOperatorAlphaShort;
    
public java.lang.StringgetVoiceOperatorNumeric()
Get current registered voice network operator numeric id.

return
numeric format of operator, null if unregistered or unknown
hide

        return mVoiceOperatorNumeric;
    
public intgetVoiceRegState()
Get current voice service state

see
#STATE_IN_SERVICE
see
#STATE_OUT_OF_SERVICE
see
#STATE_EMERGENCY_ONLY
see
#STATE_POWER_OFF
hide

        return mVoiceRegState;
    
public booleangetVoiceRoaming()
Get current voice network roaming status

return
roaming status
hide

        return mVoiceRoamingType != ROAMING_TYPE_NOT_ROAMING;
    
public intgetVoiceRoamingType()
Get current voice network roaming type

return
roaming type
hide

        return mVoiceRoamingType;
    
public inthashCode()

        return ((mVoiceRegState * 31)
                + (mDataRegState * 37)
                + mVoiceRoamingType
                + mDataRoamingType
                + (mIsManualNetworkSelection ? 1 : 0)
                + ((null == mVoiceOperatorAlphaLong) ? 0 : mVoiceOperatorAlphaLong.hashCode())
                + ((null == mVoiceOperatorAlphaShort) ? 0 : mVoiceOperatorAlphaShort.hashCode())
                + ((null == mVoiceOperatorNumeric) ? 0 : mVoiceOperatorNumeric.hashCode())
                + ((null == mDataOperatorAlphaLong) ? 0 : mDataOperatorAlphaLong.hashCode())
                + ((null == mDataOperatorAlphaShort) ? 0 : mDataOperatorAlphaShort.hashCode())
                + ((null == mDataOperatorNumeric) ? 0 : mDataOperatorNumeric.hashCode())
                + mCdmaRoamingIndicator
                + mCdmaDefaultRoamingIndicator
                + (mIsEmergencyOnly ? 1 : 0));
    
public static booleanisCdma(int radioTechnology)

hide

        return radioTechnology == RIL_RADIO_TECHNOLOGY_IS95A
                || radioTechnology == RIL_RADIO_TECHNOLOGY_IS95B
                || radioTechnology == RIL_RADIO_TECHNOLOGY_1xRTT
                || radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_0
                || radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_A
                || radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_B
                || radioTechnology == RIL_RADIO_TECHNOLOGY_EHRPD;
    
public booleanisEmergencyOnly()

hide

        return mIsEmergencyOnly;
    
public static booleanisGsm(int radioTechnology)

hide

        return radioTechnology == RIL_RADIO_TECHNOLOGY_GPRS
                || radioTechnology == RIL_RADIO_TECHNOLOGY_EDGE
                || radioTechnology == RIL_RADIO_TECHNOLOGY_UMTS
                || radioTechnology == RIL_RADIO_TECHNOLOGY_HSDPA
                || radioTechnology == RIL_RADIO_TECHNOLOGY_HSUPA
                || radioTechnology == RIL_RADIO_TECHNOLOGY_HSPA
                || radioTechnology == RIL_RADIO_TECHNOLOGY_LTE
                || radioTechnology == RIL_RADIO_TECHNOLOGY_HSPAP
                || radioTechnology == RIL_RADIO_TECHNOLOGY_GSM
                || radioTechnology == RIL_RADIO_TECHNOLOGY_TD_SCDMA;
    
public static android.telephony.ServiceStatemergeServiceStates(android.telephony.ServiceState baseSs, android.telephony.ServiceState voiceSs)
Returns a merged ServiceState consisting of the base SS with voice settings from the voice SS. The voice SS is only used if it is IN_SERVICE (otherwise the base SS is returned).

hide

        if (voiceSs.mVoiceRegState != STATE_IN_SERVICE) {
            return baseSs;
        }

        ServiceState newSs = new ServiceState(baseSs);

        // voice overrides
        newSs.mVoiceRegState = voiceSs.mVoiceRegState;
        newSs.mIsEmergencyOnly = false; // only get here if voice is IN_SERVICE

        return newSs;
    
public static android.telephony.ServiceStatenewFromBundle(android.os.Bundle m)
Create a new ServiceState from a intent notifier Bundle This method is used by PhoneStateIntentReceiver and maybe by external applications.

param
m Bundle from intent notifier
return
newly created ServiceState
hide

        ServiceState ret;
        ret = new ServiceState();
        ret.setFromNotifierBundle(m);
        return ret;
    
private intrilRadioTechnologyToNetworkType(int rt)

        switch(rt) {
        case ServiceState.RIL_RADIO_TECHNOLOGY_GPRS:
            return TelephonyManager.NETWORK_TYPE_GPRS;
        case ServiceState.RIL_RADIO_TECHNOLOGY_EDGE:
            return TelephonyManager.NETWORK_TYPE_EDGE;
        case ServiceState.RIL_RADIO_TECHNOLOGY_UMTS:
            return TelephonyManager.NETWORK_TYPE_UMTS;
        case ServiceState.RIL_RADIO_TECHNOLOGY_HSDPA:
            return TelephonyManager.NETWORK_TYPE_HSDPA;
        case ServiceState.RIL_RADIO_TECHNOLOGY_HSUPA:
            return TelephonyManager.NETWORK_TYPE_HSUPA;
        case ServiceState.RIL_RADIO_TECHNOLOGY_HSPA:
            return TelephonyManager.NETWORK_TYPE_HSPA;
        case ServiceState.RIL_RADIO_TECHNOLOGY_IS95A:
        case ServiceState.RIL_RADIO_TECHNOLOGY_IS95B:
            return TelephonyManager.NETWORK_TYPE_CDMA;
        case ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT:
            return TelephonyManager.NETWORK_TYPE_1xRTT;
        case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_0:
            return TelephonyManager.NETWORK_TYPE_EVDO_0;
        case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_A:
            return TelephonyManager.NETWORK_TYPE_EVDO_A;
        case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_B:
            return TelephonyManager.NETWORK_TYPE_EVDO_B;
        case ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD:
            return TelephonyManager.NETWORK_TYPE_EHRPD;
        case ServiceState.RIL_RADIO_TECHNOLOGY_LTE:
            return TelephonyManager.NETWORK_TYPE_LTE;
        case ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP:
            return TelephonyManager.NETWORK_TYPE_HSPAP;
        case ServiceState.RIL_RADIO_TECHNOLOGY_GSM:
            return TelephonyManager.NETWORK_TYPE_GSM;
        default:
            return TelephonyManager.NETWORK_TYPE_UNKNOWN;
        }
    
public static java.lang.StringrilRadioTechnologyToString(int rt)
Convert radio technology to String

param
radioTechnology
return
String representation of the RAT
hide

        String rtString;

        switch(rt) {
            case RIL_RADIO_TECHNOLOGY_UNKNOWN:
                rtString = "Unknown";
                break;
            case RIL_RADIO_TECHNOLOGY_GPRS:
                rtString = "GPRS";
                break;
            case RIL_RADIO_TECHNOLOGY_EDGE:
                rtString = "EDGE";
                break;
            case RIL_RADIO_TECHNOLOGY_UMTS:
                rtString = "UMTS";
                break;
            case RIL_RADIO_TECHNOLOGY_IS95A:
                rtString = "CDMA-IS95A";
                break;
            case RIL_RADIO_TECHNOLOGY_IS95B:
                rtString = "CDMA-IS95B";
                break;
            case RIL_RADIO_TECHNOLOGY_1xRTT:
                rtString = "1xRTT";
                break;
            case RIL_RADIO_TECHNOLOGY_EVDO_0:
                rtString = "EvDo-rev.0";
                break;
            case RIL_RADIO_TECHNOLOGY_EVDO_A:
                rtString = "EvDo-rev.A";
                break;
            case RIL_RADIO_TECHNOLOGY_HSDPA:
                rtString = "HSDPA";
                break;
            case RIL_RADIO_TECHNOLOGY_HSUPA:
                rtString = "HSUPA";
                break;
            case RIL_RADIO_TECHNOLOGY_HSPA:
                rtString = "HSPA";
                break;
            case RIL_RADIO_TECHNOLOGY_EVDO_B:
                rtString = "EvDo-rev.B";
                break;
            case RIL_RADIO_TECHNOLOGY_EHRPD:
                rtString = "eHRPD";
                break;
            case RIL_RADIO_TECHNOLOGY_LTE:
                rtString = "LTE";
                break;
            case RIL_RADIO_TECHNOLOGY_HSPAP:
                rtString = "HSPAP";
                break;
            case RIL_RADIO_TECHNOLOGY_GSM:
                rtString = "GSM";
                break;
            default:
                rtString = "Unexpected";
                Rlog.w(LOG_TAG, "Unexpected radioTechnology=" + rt);
                break;
        }
        return rtString;
    
public voidsetCdmaDefaultRoamingIndicator(int roaming)

hide

        this.mCdmaDefaultRoamingIndicator = roaming;
    
public voidsetCdmaEriIconIndex(int index)

hide

        this.mCdmaEriIconIndex = index;
    
public voidsetCdmaEriIconMode(int mode)

hide

        this.mCdmaEriIconMode = mode;
    
public voidsetCdmaRoamingIndicator(int roaming)

hide

        this.mCdmaRoamingIndicator = roaming;
    
public voidsetCssIndicator(int css)

hide

        this.mCssIndicator = (css != 0);
    
public voidsetDataOperatorAlphaLong(java.lang.String longName)

hide

        mDataOperatorAlphaLong = longName;
    
public voidsetDataOperatorName(java.lang.String longName, java.lang.String shortName, java.lang.String numeric)

hide

        mDataOperatorAlphaLong = longName;
        mDataOperatorAlphaShort = shortName;
        mDataOperatorNumeric = numeric;
    
public voidsetDataRegState(int state)

hide

        mDataRegState = state;
        if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setDataRegState=" + mDataRegState);
    
public voidsetDataRoaming(boolean dataRoaming)

hide

        mDataRoamingType = (dataRoaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
    
public voidsetDataRoamingType(int type)

hide

        mDataRoamingType = type;
    
public voidsetEmergencyOnly(boolean emergencyOnly)

hide

        mIsEmergencyOnly = emergencyOnly;
    
private voidsetFromNotifierBundle(android.os.Bundle m)
Set ServiceState based on intent notifier map.

param
m intent notifier map
hide

        mVoiceRegState = m.getInt("voiceRegState");
        mDataRegState = m.getInt("dataRegState");
        mVoiceRoamingType = m.getInt("voiceRoamingType");
        mDataRoamingType = m.getInt("dataRoamingType");
        mVoiceOperatorAlphaLong = m.getString("operator-alpha-long");
        mVoiceOperatorAlphaShort = m.getString("operator-alpha-short");
        mVoiceOperatorNumeric = m.getString("operator-numeric");
        mDataOperatorAlphaLong = m.getString("data-operator-alpha-long");
        mDataOperatorAlphaShort = m.getString("data-operator-alpha-short");
        mDataOperatorNumeric = m.getString("data-operator-numeric");
        mIsManualNetworkSelection = m.getBoolean("manual");
        mRilVoiceRadioTechnology = m.getInt("radioTechnology");
        mRilDataRadioTechnology = m.getInt("dataRadioTechnology");
        mCssIndicator = m.getBoolean("cssIndicator");
        mNetworkId = m.getInt("networkId");
        mSystemId = m.getInt("systemId");
        mCdmaRoamingIndicator = m.getInt("cdmaRoamingIndicator");
        mCdmaDefaultRoamingIndicator = m.getInt("cdmaDefaultRoamingIndicator");
        mIsEmergencyOnly = m.getBoolean("emergencyOnly");
    
public voidsetIsManualSelection(boolean isManual)

        mIsManualNetworkSelection = isManual;
    
private voidsetNullState(int state)

        if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setNullState=" + state);
        mVoiceRegState = state;
        mDataRegState = state;
        mVoiceRoamingType = ROAMING_TYPE_NOT_ROAMING;
        mDataRoamingType = ROAMING_TYPE_NOT_ROAMING;
        mVoiceOperatorAlphaLong = null;
        mVoiceOperatorAlphaShort = null;
        mVoiceOperatorNumeric = null;
        mDataOperatorAlphaLong = null;
        mDataOperatorAlphaShort = null;
        mDataOperatorNumeric = null;
        mIsManualNetworkSelection = false;
        mRilVoiceRadioTechnology = 0;
        mRilDataRadioTechnology = 0;
        mCssIndicator = false;
        mNetworkId = -1;
        mSystemId = -1;
        mCdmaRoamingIndicator = -1;
        mCdmaDefaultRoamingIndicator = -1;
        mCdmaEriIconIndex = -1;
        mCdmaEriIconMode = -1;
        mIsEmergencyOnly = false;
    
public voidsetOperatorAlphaLong(java.lang.String longName)
In CDMA, mOperatorAlphaLong can be set from the ERI text. This is done from the CDMAPhone and not from the CdmaServiceStateTracker.

hide

        mVoiceOperatorAlphaLong = longName;
        mDataOperatorAlphaLong = longName;
    
public voidsetOperatorName(java.lang.String longName, java.lang.String shortName, java.lang.String numeric)

        mVoiceOperatorAlphaLong = longName;
        mVoiceOperatorAlphaShort = shortName;
        mVoiceOperatorNumeric = numeric;
        mDataOperatorAlphaLong = longName;
        mDataOperatorAlphaShort = shortName;
        mDataOperatorNumeric = numeric;
    
public voidsetRilDataRadioTechnology(int rt)

hide

        this.mRilDataRadioTechnology = rt;
        if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setDataRadioTechnology=" + mRilDataRadioTechnology);
    
public voidsetRilVoiceRadioTechnology(int rt)

hide

        this.mRilVoiceRadioTechnology = rt;
    
public voidsetRoaming(boolean roaming)

        mVoiceRoamingType = (roaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
        mDataRoamingType = mVoiceRoamingType;
    
public voidsetState(int state)

        setVoiceRegState(state);
        if (DBG) Rlog.e(LOG_TAG, "[ServiceState] setState deprecated use setVoiceRegState()");
    
public voidsetStateOff()

        setNullState(STATE_POWER_OFF);
    
public voidsetStateOutOfService()

        setNullState(STATE_OUT_OF_SERVICE);
    
public voidsetSystemAndNetworkId(int systemId, int networkId)

hide

        this.mSystemId = systemId;
        this.mNetworkId = networkId;
    
public voidsetVoiceOperatorAlphaLong(java.lang.String longName)

hide

        mVoiceOperatorAlphaLong = longName;
    
public voidsetVoiceOperatorName(java.lang.String longName, java.lang.String shortName, java.lang.String numeric)

hide

        mVoiceOperatorAlphaLong = longName;
        mVoiceOperatorAlphaShort = shortName;
        mVoiceOperatorNumeric = numeric;
    
public voidsetVoiceRegState(int state)

hide

        mVoiceRegState = state;
        if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setVoiceRegState=" + mVoiceRegState);
    
public voidsetVoiceRoaming(boolean roaming)

hide

        mVoiceRoamingType = (roaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
    
public voidsetVoiceRoamingType(int type)

hide

        mVoiceRoamingType = type;
    
public java.lang.StringtoString()

        String radioTechnology = rilRadioTechnologyToString(mRilVoiceRadioTechnology);
        String dataRadioTechnology = rilRadioTechnologyToString(mRilDataRadioTechnology);

        return (mVoiceRegState + " " + mDataRegState
                + " "
                + "voice " + getRoamingLogString(mVoiceRoamingType)
                + " "
                + "data " + getRoamingLogString(mDataRoamingType)
                + " " + mVoiceOperatorAlphaLong
                + " " + mVoiceOperatorAlphaShort
                + " " + mVoiceOperatorNumeric
                + " " + mDataOperatorAlphaLong
                + " " + mDataOperatorAlphaShort
                + " " + mDataOperatorNumeric
                + " " + (mIsManualNetworkSelection ? "(manual)" : "")
                + " " + radioTechnology
                + " " + dataRadioTechnology
                + " " + (mCssIndicator ? "CSS supported" : "CSS not supported")
                + " " + mNetworkId
                + " " + mSystemId
                + " RoamInd=" + mCdmaRoamingIndicator
                + " DefRoamInd=" + mCdmaDefaultRoamingIndicator
                + " EmergOnly=" + mIsEmergencyOnly);
    
public voidwriteToParcel(android.os.Parcel out, int flags)

        out.writeInt(mVoiceRegState);
        out.writeInt(mDataRegState);
        out.writeInt(mVoiceRoamingType);
        out.writeInt(mDataRoamingType);
        out.writeString(mVoiceOperatorAlphaLong);
        out.writeString(mVoiceOperatorAlphaShort);
        out.writeString(mVoiceOperatorNumeric);
        out.writeString(mDataOperatorAlphaLong);
        out.writeString(mDataOperatorAlphaShort);
        out.writeString(mDataOperatorNumeric);
        out.writeInt(mIsManualNetworkSelection ? 1 : 0);
        out.writeInt(mRilVoiceRadioTechnology);
        out.writeInt(mRilDataRadioTechnology);
        out.writeInt(mCssIndicator ? 1 : 0);
        out.writeInt(mNetworkId);
        out.writeInt(mSystemId);
        out.writeInt(mCdmaRoamingIndicator);
        out.writeInt(mCdmaDefaultRoamingIndicator);
        out.writeInt(mCdmaEriIconIndex);
        out.writeInt(mCdmaEriIconMode);
        out.writeInt(mIsEmergencyOnly ? 1 : 0);