FileDocCategorySizeDatePackage
RadioAccessFamily.javaAPI DocAndroid 5.1 API6655Thu Mar 12 22:22:42 GMT 2015android.telephony

RadioAccessFamily

public class RadioAccessFamily extends Object implements android.os.Parcelable
Object to indicate the phone radio type and access technology.
hide

Fields Summary
public static final int
RAF_UNKNOWN
public static final int
RAF_GPRS
public static final int
RAF_EDGE
public static final int
RAF_UMTS
public static final int
RAF_IS95A
public static final int
RAF_IS95B
public static final int
RAF_1xRTT
public static final int
RAF_EVDO_0
public static final int
RAF_EVDO_A
public static final int
RAF_HSDPA
public static final int
RAF_HSUPA
public static final int
RAF_HSPA
public static final int
RAF_EVDO_B
public static final int
RAF_EHRPD
public static final int
RAF_LTE
public static final int
RAF_HSPAP
public static final int
RAF_GSM
public static final int
RAF_TD_SCDMA
private int
mPhoneId
private int
mRadioAccessFamily
public static final Creator
CREATOR
Implement the Parcelable interface.
Constructors Summary
public RadioAccessFamily(int phoneId, int radioAccessFamily)
Constructor.

param
phoneId the phone ID
param
radioAccessFamily the phone radio access family defined in RadioAccessFamily. It's a bit mask value to represent the support type.


                                                 
         
        mPhoneId = phoneId;
        mRadioAccessFamily = radioAccessFamily;
    
Methods Summary
public intdescribeContents()
Implement the Parcelable interface.

return
describe content

        return 0;
    
public intgetPhoneId()
Get phone ID.

return
phone ID

        return mPhoneId;
    
public intgetRadioAccessFamily()
get radio access family.

return
radio access family

        return mRadioAccessFamily;
    
public static intgetRafFromNetworkType(int type)


         
        final int GSM = RAF_GSM | RAF_GPRS | RAF_EDGE;
        final int HS = RAF_HSUPA | RAF_HSDPA | RAF_HSPA | RAF_HSPAP;
        final int CDMA = RAF_IS95A | RAF_IS95B | RAF_1xRTT;
        final int EVDO = RAF_EVDO_0 | RAF_EVDO_A | RAF_EVDO_B;
        final int WCDMA = HS | RAF_UMTS;

        int raf;

        switch (type) {
            case RILConstants.NETWORK_MODE_WCDMA_PREF:
                raf = GSM | WCDMA;
                break;
            case RILConstants.NETWORK_MODE_GSM_ONLY:
                raf = GSM;
                break;
            case RILConstants.NETWORK_MODE_WCDMA_ONLY:
                raf = WCDMA;
                break;
            case RILConstants.NETWORK_MODE_GSM_UMTS:
                raf = GSM | WCDMA;
                break;
            case RILConstants.NETWORK_MODE_CDMA:
                raf = CDMA;
                break;
            case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO:
                raf = RAF_LTE | CDMA | EVDO;
                break;
            case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA:
                raf = RAF_LTE | GSM | WCDMA;
                break;
            case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
                raf = RAF_LTE | CDMA | EVDO | GSM | WCDMA;
                break;
            case RILConstants.NETWORK_MODE_LTE_ONLY:
                raf = RAF_LTE;
                break;
            case RILConstants.NETWORK_MODE_LTE_WCDMA:
                raf = RAF_LTE | WCDMA;
                break;
            case RILConstants.NETWORK_MODE_CDMA_NO_EVDO:
                raf = CDMA;
                break;
            case RILConstants.NETWORK_MODE_EVDO_NO_CDMA:
                raf = EVDO;
                break;
            case RILConstants.NETWORK_MODE_GLOBAL:
                raf = GSM | WCDMA | CDMA | EVDO;
                break;
            default:
                raf = RAF_UNKNOWN;
                break;
        }
        return raf;
    
public java.lang.StringtoString()

        String ret = "{ mPhoneId = " + mPhoneId
                + ", mRadioAccessFamily = " + mRadioAccessFamily
                + "}";
        return ret;
    
public voidwriteToParcel(android.os.Parcel outParcel, int flags)
Implement the Parcelable interface.

param
outParcel The Parcel in which the object should be written.
param
flags Additional flags about how the object should be written.

        outParcel.writeInt(mPhoneId);
        outParcel.writeInt(mRadioAccessFamily);