SmsCbLocationpublic class SmsCbLocation extends Object implements android.os.ParcelableRepresents the location and geographical scope of a cell broadcast message.
For GSM/UMTS, the Location Area and Cell ID are set when the broadcast
geographical scope is cell wide or Location Area wide. For CDMA, the
broadcast geographical scope is always PLMN wide. |
Fields Summary |
---|
private final String | mPlmnThe PLMN. Note that this field may be an empty string, but isn't allowed to be null. | private final int | mLac | private final int | mCid | public static final Parcelable.Creator | CREATOR |
Constructors Summary |
---|
public SmsCbLocation()Construct an empty location object. This is used for some test cases, and for
cell broadcasts saved in older versions of the database without location info.
mPlmn = "";
mLac = -1;
mCid = -1;
| public SmsCbLocation(String plmn)Construct a location object for the PLMN. This class is immutable, so
the same object can be reused for multiple broadcasts.
mPlmn = plmn;
mLac = -1;
mCid = -1;
| public SmsCbLocation(String plmn, int lac, int cid)Construct a location object for the PLMN, LAC, and Cell ID. This class is immutable, so
the same object can be reused for multiple broadcasts.
mPlmn = plmn;
mLac = lac;
mCid = cid;
| public SmsCbLocation(android.os.Parcel in)Initialize the object from a Parcel.
mPlmn = in.readString();
mLac = in.readInt();
mCid = in.readInt();
|
Methods Summary |
---|
public int | describeContents()Describe the kinds of special objects contained in the marshalled representation.
return 0;
| public boolean | equals(java.lang.Object o)
if (o == this) {
return true;
}
if (o == null || !(o instanceof SmsCbLocation)) {
return false;
}
SmsCbLocation other = (SmsCbLocation) o;
return mPlmn.equals(other.mPlmn) && mLac == other.mLac && mCid == other.mCid;
| public int | getCid()Returns the GSM or UMTS cell ID.
return mCid;
| public int | getLac()Returns the GSM location area code, or UMTS service area code.
return mLac;
| public java.lang.String | getPlmn()Returns the MCC/MNC of the network as a String.
return mPlmn;
| public int | hashCode()
int hash = mPlmn.hashCode();
hash = hash * 31 + mLac;
hash = hash * 31 + mCid;
return hash;
| public boolean | isInLocationArea(android.telephony.SmsCbLocation area)Test whether this location is within the location area of the specified object.
if (mCid != -1 && mCid != area.mCid) {
return false;
}
if (mLac != -1 && mLac != area.mLac) {
return false;
}
return mPlmn.equals(area.mPlmn);
| public boolean | isInLocationArea(java.lang.String plmn, int lac, int cid)Test whether this location is within the location area of the CellLocation.
if (!mPlmn.equals(plmn)) {
return false;
}
if (mLac != -1 && mLac != lac) {
return false;
}
if (mCid != -1 && mCid != cid) {
return false;
}
return true;
| public java.lang.String | toString()
return '[" + mPlmn + '," + mLac + '," + mCid + ']";
| public void | writeToParcel(android.os.Parcel dest, int flags)Flatten this object into a Parcel.
dest.writeString(mPlmn);
dest.writeInt(mLac);
dest.writeInt(mCid);
|
|