FileDocCategorySizeDatePackage
CellIdentityGsm.javaAPI DocAndroid 5.1 API5241Thu Mar 12 22:22:42 GMT 2015android.telephony

CellIdentityGsm

public final class CellIdentityGsm extends Object implements android.os.Parcelable
CellIdentity to represent a unique GSM cell

Fields Summary
private static final String
LOG_TAG
private static final boolean
DBG
private final int
mMcc
private final int
mMnc
private final int
mLac
private final int
mCid
public static final Creator
CREATOR
Implement the Parcelable interface
Constructors Summary
public CellIdentityGsm()

hide


          
      
        mMcc = Integer.MAX_VALUE;
        mMnc = Integer.MAX_VALUE;
        mLac = Integer.MAX_VALUE;
        mCid = Integer.MAX_VALUE;
    
private CellIdentityGsm(android.os.Parcel in)
Construct from Parcel, type has already been processed

        mMcc = in.readInt();
        mMnc = in.readInt();
        mLac = in.readInt();
        mCid = in.readInt();
        if (DBG) log("CellIdentityGsm(Parcel): " + toString());
    
public CellIdentityGsm(int mcc, int mnc, int lac, int cid)
public constructor

param
mcc 3-digit Mobile Country Code, 0..999
param
mnc 2 or 3-digit Mobile Network Code, 0..999
param
lac 16-bit Location Area Code, 0..65535
param
cid 16-bit GSM Cell Identity or 28-bit UMTS Cell Identity
hide

        mMcc = mcc;
        mMnc = mnc;
        mLac = lac;
        mCid = cid;
    
private CellIdentityGsm(CellIdentityGsm cid)

        mMcc = cid.mMcc;
        mMnc = cid.mMnc;
        mLac = cid.mLac;
        mCid = cid.mCid;
    
Methods Summary
android.telephony.CellIdentityGsmcopy()

       return new CellIdentityGsm(this);
    
public intdescribeContents()
Implement the Parcelable interface

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

        if (super.equals(other)) {
            try {
                CellIdentityGsm o = (CellIdentityGsm)other;
                return mMcc == o.mMcc &&
                        mMnc == o.mMnc &&
                        mLac == o.mLac &&
                        mCid == o.mCid;
            } catch (ClassCastException e) {
                return false;
            }
        } else {
            return false;
        }
    
public intgetCid()

return
CID Either 16-bit GSM Cell Identity described in TS 27.007, 0..65535, Integer.MAX_VALUE if unknown

        return mCid;
    
public intgetLac()

return
16-bit Location Area Code, 0..65535, Integer.MAX_VALUE if unknown

        return mLac;
    
public intgetMcc()

return
3-digit Mobile Country Code, 0..999, Integer.MAX_VALUE if unknown

        return mMcc;
    
public intgetMnc()

return
2 or 3-digit Mobile Network Code, 0..999, Integer.MAX_VALUE if unknown

        return mMnc;
    
public intgetPsc()

return
Integer.MAX_VALUE, undefined for GSM

        return Integer.MAX_VALUE;
    
public inthashCode()

        int primeNum = 31;
        return (mMcc * primeNum) + (mMnc * primeNum) + (mLac * primeNum) + (mCid * primeNum);
    
private static voidlog(java.lang.String s)
log


          
         
        Rlog.w(LOG_TAG, s);
    
public java.lang.StringtoString()

        StringBuilder sb = new StringBuilder("CellIdentityGsm:{");
        sb.append(" mMcc=").append(mMcc);
        sb.append(" mMnc=").append(mMnc);
        sb.append(" mLac=").append(mLac);
        sb.append(" mCid=").append(mCid);
        sb.append("}");

        return sb.toString();
    
public voidwriteToParcel(android.os.Parcel dest, int flags)
Implement the Parcelable interface

        if (DBG) log("writeToParcel(Parcel, int): " + toString());
        dest.writeInt(mMcc);
        dest.writeInt(mMnc);
        dest.writeInt(mLac);
        dest.writeInt(mCid);