summaryrefslogtreecommitdiff
path: root/telephony/java/android/telephony/CellIdentity.java
diff options
context:
space:
mode:
Diffstat (limited to 'telephony/java/android/telephony/CellIdentity.java')
-rw-r--r--telephony/java/android/telephony/CellIdentity.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/CellIdentity.java b/telephony/java/android/telephony/CellIdentity.java
index 0c2f1f325793..390a79ab1b88 100644
--- a/telephony/java/android/telephony/CellIdentity.java
+++ b/telephony/java/android/telephony/CellIdentity.java
@@ -68,6 +68,12 @@ public abstract class CellIdentity implements Parcelable {
/** @hide */
protected String mAlphaShort;
+ // For GSM, WCDMA, TDSCDMA, LTE and NR, Cell Global ID is defined in 3GPP TS 23.003.
+ // For CDMA, its defined as System Id + Network Id + Basestation Id.
+ /** @hide */
+ protected String mGlobalCellId;
+
+
/** @hide */
protected CellIdentity(@Nullable String tag, int type, @Nullable String mcc,
@Nullable String mnc, @Nullable String alphal, @Nullable String alphas) {
@@ -182,6 +188,36 @@ public abstract class CellIdentity implements Parcelable {
}
/**
+ * @return Global Cell ID
+ * @hide
+ */
+ @Nullable
+ public String getGlobalCellId() {
+ return mGlobalCellId;
+ }
+
+ /**
+ * @param ci a CellIdentity to compare to the current CellIdentity.
+ * @return true if ci has the same technology and Global Cell ID; false, otherwise.
+ * @hide
+ */
+ public boolean isSameCell(@Nullable CellIdentity ci) {
+ if (ci == null) return false;
+ if (this.getClass() != ci.getClass()) return false;
+ if (this.getGlobalCellId() == null || ci.getGlobalCellId() == null) return false;
+ return TextUtils.equals(this.getGlobalCellId(), ci.getGlobalCellId());
+ }
+
+ /** @hide */
+ protected String getPlmn() {
+ if (mMccStr == null || mMncStr == null) return null;
+ return mMccStr + mMncStr;
+ }
+
+ /** @hide */
+ protected abstract void updateGlobalCellId();
+
+ /**
* @return a CellLocation object for this CellIdentity
* @hide
*/