FileDocCategorySizeDatePackage
GsmCellLocation.javaAPI DocAndroid 5.1 API3654Thu Mar 12 22:22:42 GMT 2015android.telephony.gsm

GsmCellLocation

public class GsmCellLocation extends android.telephony.CellLocation
Represents the cell location on a GSM phone.

Fields Summary
private int
mLac
private int
mCid
private int
mPsc
Constructors Summary
public GsmCellLocation()
Empty constructor. Initializes the LAC and CID to -1.

        mLac = -1;
        mCid = -1;
        mPsc = -1;
    
public GsmCellLocation(android.os.Bundle bundle)
Initialize the object from a bundle.

        mLac = bundle.getInt("lac", mLac);
        mCid = bundle.getInt("cid", mCid);
        mPsc = bundle.getInt("psc", mPsc);
    
Methods Summary
public booleanequals(java.lang.Object o)

        GsmCellLocation s;

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

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

        return equalsHandlesNulls(mLac, s.mLac) && equalsHandlesNulls(mCid, s.mCid)
            && equalsHandlesNulls(mPsc, s.mPsc);
    
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

        m.putInt("lac", mLac);
        m.putInt("cid", mCid);
        m.putInt("psc", mPsc);
    
public intgetCid()

return
gsm cell id, -1 if unknown, 0xffff max legal value

        return mCid;
    
public intgetLac()

return
gsm location area code, -1 if unknown, 0xffff max legal value

        return mLac;
    
public intgetPsc()
On a UMTS network, returns the primary scrambling code of the serving cell.

return
primary scrambling code for UMTS, -1 if unknown or GSM

        return mPsc;
    
public inthashCode()

        return mLac ^ mCid;
    
public booleanisEmpty()

hide

        return (mLac == -1 && mCid == -1 && mPsc == -1);
    
public voidsetLacAndCid(int lac, int cid)
Set the location area code and the cell id.

        mLac = lac;
        mCid = cid;
    
public voidsetPsc(int psc)
Set the primary scrambling code.

hide

        mPsc = psc;
    
public voidsetStateInvalid()
Invalidate this object. The location area code and the cell id are set to -1.

        mLac = -1;
        mCid = -1;
        mPsc = -1;
    
public java.lang.StringtoString()

        return "["+ mLac + "," + mCid + "," + mPsc + "]";