Merge "Merge CellInfo TYPE Enums"
diff --git a/telephony/java/android/telephony/CellIdentity.java b/telephony/java/android/telephony/CellIdentity.java
index 2a41829..c240dbb 100644
--- a/telephony/java/android/telephony/CellIdentity.java
+++ b/telephony/java/android/telephony/CellIdentity.java
@@ -17,14 +17,11 @@
package android.telephony;
import android.annotation.CallSuper;
-import android.annotation.IntDef;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
import java.util.Objects;
/**
@@ -32,44 +29,6 @@
* CellIdentityXxx which represents cell identity for specific network access technology.
*/
public abstract class CellIdentity implements Parcelable {
- /**
- * Cell identity type
- * @hide
- */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = "TYPE_", value = {TYPE_GSM, TYPE_CDMA, TYPE_LTE, TYPE_WCDMA, TYPE_TDSCDMA})
- public @interface Type {}
-
- /**
- * Unknown cell identity type
- * @hide
- */
- public static final int TYPE_UNKNOWN = 0;
- /**
- * GSM cell identity type
- * @hide
- */
- public static final int TYPE_GSM = 1;
- /**
- * CDMA cell identity type
- * @hide
- */
- public static final int TYPE_CDMA = 2;
- /**
- * LTE cell identity type
- * @hide
- */
- public static final int TYPE_LTE = 3;
- /**
- * WCDMA cell identity type
- * @hide
- */
- public static final int TYPE_WCDMA = 4;
- /**
- * TDS-CDMA cell identity type
- * @hide
- */
- public static final int TYPE_TDSCDMA = 5;
/** @hide */
public static final int INVALID_CHANNEL_NUMBER = -1;
@@ -138,7 +97,9 @@
* @hide
* @return The type of the cell identity
*/
- public @Type int getType() { return mType; }
+ public @CellInfo.Type int getType() {
+ return mType;
+ }
/**
* Returns the channel number of the cell identity.
@@ -217,11 +178,12 @@
public CellIdentity createFromParcel(Parcel in) {
int type = in.readInt();
switch (type) {
- case TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in);
- case TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in);
- case TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in);
- case TYPE_LTE: return CellIdentityLte.createFromParcelBody(in);
- case TYPE_TDSCDMA: return CellIdentityTdscdma.createFromParcelBody(in);
+ case CellInfo.TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in);
+ case CellInfo.TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in);
+ case CellInfo.TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in);
+ case CellInfo.TYPE_LTE: return CellIdentityLte.createFromParcelBody(in);
+ case CellInfo.TYPE_TDSCDMA:
+ return CellIdentityTdscdma.createFromParcelBody(in);
default: throw new IllegalArgumentException("Bad Cell identity Parcel");
}
}
diff --git a/telephony/java/android/telephony/CellIdentityCdma.java b/telephony/java/android/telephony/CellIdentityCdma.java
index 58a2c45..2809066 100644
--- a/telephony/java/android/telephony/CellIdentityCdma.java
+++ b/telephony/java/android/telephony/CellIdentityCdma.java
@@ -54,7 +54,7 @@
* @hide
*/
public CellIdentityCdma() {
- super(TAG, TYPE_CDMA, null, null, null, null);
+ super(TAG, CellInfo.TYPE_CDMA, null, null, null, null);
mNetworkId = Integer.MAX_VALUE;
mSystemId = Integer.MAX_VALUE;
mBasestationId = Integer.MAX_VALUE;
@@ -94,7 +94,7 @@
*/
public CellIdentityCdma(int nid, int sid, int bid, int lon, int lat, String alphal,
String alphas) {
- super(TAG, TYPE_CDMA, null, null, alphal, alphas);
+ super(TAG, CellInfo.TYPE_CDMA, null, null, alphal, alphas);
mNetworkId = nid;
mSystemId = sid;
mBasestationId = bid;
@@ -213,7 +213,7 @@
@Override
public void writeToParcel(Parcel dest, int flags) {
if (DBG) log("writeToParcel(Parcel, int): " + toString());
- super.writeToParcel(dest, TYPE_CDMA);
+ super.writeToParcel(dest, CellInfo.TYPE_CDMA);
dest.writeInt(mNetworkId);
dest.writeInt(mSystemId);
dest.writeInt(mBasestationId);
@@ -223,7 +223,7 @@
/** Construct from Parcel, type has already been processed */
private CellIdentityCdma(Parcel in) {
- super(TAG, TYPE_CDMA, in);
+ super(TAG, CellInfo.TYPE_CDMA, in);
mNetworkId = in.readInt();
mSystemId = in.readInt();
mBasestationId = in.readInt();
diff --git a/telephony/java/android/telephony/CellIdentityGsm.java b/telephony/java/android/telephony/CellIdentityGsm.java
index c697880fa..4031254a 100644
--- a/telephony/java/android/telephony/CellIdentityGsm.java
+++ b/telephony/java/android/telephony/CellIdentityGsm.java
@@ -42,7 +42,7 @@
* @hide
*/
public CellIdentityGsm() {
- super(TAG, TYPE_GSM, null, null, null, null);
+ super(TAG, CellInfo.TYPE_GSM, null, null, null, null);
mLac = Integer.MAX_VALUE;
mCid = Integer.MAX_VALUE;
mArfcn = Integer.MAX_VALUE;
@@ -92,7 +92,7 @@
*/
public CellIdentityGsm(int lac, int cid, int arfcn, int bsic, String mccStr,
String mncStr, String alphal, String alphas) {
- super(TAG, TYPE_GSM, mccStr, mncStr, alphal, alphas);
+ super(TAG, CellInfo.TYPE_GSM, mccStr, mncStr, alphal, alphas);
mLac = lac;
mCid = cid;
mArfcn = arfcn;
@@ -237,7 +237,7 @@
@Override
public void writeToParcel(Parcel dest, int flags) {
if (DBG) log("writeToParcel(Parcel, int): " + toString());
- super.writeToParcel(dest, TYPE_GSM);
+ super.writeToParcel(dest, CellInfo.TYPE_GSM);
dest.writeInt(mLac);
dest.writeInt(mCid);
dest.writeInt(mArfcn);
@@ -246,7 +246,7 @@
/** Construct from Parcel, type has already been processed */
private CellIdentityGsm(Parcel in) {
- super(TAG, TYPE_GSM, in);
+ super(TAG, CellInfo.TYPE_GSM, in);
mLac = in.readInt();
mCid = in.readInt();
mArfcn = in.readInt();
diff --git a/telephony/java/android/telephony/CellIdentityLte.java b/telephony/java/android/telephony/CellIdentityLte.java
index 177fced..5257372 100644
--- a/telephony/java/android/telephony/CellIdentityLte.java
+++ b/telephony/java/android/telephony/CellIdentityLte.java
@@ -44,7 +44,7 @@
* @hide
*/
public CellIdentityLte() {
- super(TAG, TYPE_LTE, null, null, null, null);
+ super(TAG, CellInfo.TYPE_LTE, null, null, null, null);
mCi = Integer.MAX_VALUE;
mPci = Integer.MAX_VALUE;
mTac = Integer.MAX_VALUE;
@@ -99,7 +99,7 @@
*/
public CellIdentityLte(int ci, int pci, int tac, int earfcn, int bandwidth, String mccStr,
String mncStr, String alphal, String alphas) {
- super(TAG, TYPE_LTE, mccStr, mncStr, alphal, alphas);
+ super(TAG, CellInfo.TYPE_LTE, mccStr, mncStr, alphal, alphas);
mCi = ci;
mPci = pci;
mTac = tac;
@@ -241,7 +241,7 @@
@Override
public void writeToParcel(Parcel dest, int flags) {
if (DBG) log("writeToParcel(Parcel, int): " + toString());
- super.writeToParcel(dest, TYPE_LTE);
+ super.writeToParcel(dest, CellInfo.TYPE_LTE);
dest.writeInt(mCi);
dest.writeInt(mPci);
dest.writeInt(mTac);
@@ -251,7 +251,7 @@
/** Construct from Parcel, type has already been processed */
private CellIdentityLte(Parcel in) {
- super(TAG, TYPE_LTE, in);
+ super(TAG, CellInfo.TYPE_LTE, in);
mCi = in.readInt();
mPci = in.readInt();
mTac = in.readInt();
diff --git a/telephony/java/android/telephony/CellIdentityTdscdma.java b/telephony/java/android/telephony/CellIdentityTdscdma.java
index b99fe46..21b9601 100644
--- a/telephony/java/android/telephony/CellIdentityTdscdma.java
+++ b/telephony/java/android/telephony/CellIdentityTdscdma.java
@@ -40,7 +40,7 @@
* @hide
*/
public CellIdentityTdscdma() {
- super(TAG, TYPE_TDSCDMA, null, null, null, null);
+ super(TAG, CellInfo.TYPE_TDSCDMA, null, null, null, null);
mLac = Integer.MAX_VALUE;
mCid = Integer.MAX_VALUE;
mCpid = Integer.MAX_VALUE;
@@ -75,7 +75,7 @@
*/
public CellIdentityTdscdma(String mcc, String mnc, int lac, int cid, int cpid, int uarfcn,
String alphal, String alphas) {
- super(TAG, TYPE_TDSCDMA, mcc, mnc, alphal, alphas);
+ super(TAG, CellInfo.TYPE_TDSCDMA, mcc, mnc, alphal, alphas);
mLac = lac;
mCid = cid;
mCpid = cpid;
@@ -175,7 +175,7 @@
@Override
public void writeToParcel(Parcel dest, int flags) {
if (DBG) log("writeToParcel(Parcel, int): " + toString());
- super.writeToParcel(dest, TYPE_TDSCDMA);
+ super.writeToParcel(dest, CellInfo.TYPE_TDSCDMA);
dest.writeInt(mLac);
dest.writeInt(mCid);
dest.writeInt(mCpid);
@@ -184,7 +184,7 @@
/** Construct from Parcel, type has already been processed */
private CellIdentityTdscdma(Parcel in) {
- super(TAG, TYPE_TDSCDMA, in);
+ super(TAG, CellInfo.TYPE_TDSCDMA, in);
mLac = in.readInt();
mCid = in.readInt();
mCpid = in.readInt();
diff --git a/telephony/java/android/telephony/CellIdentityWcdma.java b/telephony/java/android/telephony/CellIdentityWcdma.java
index 43f9406..a4ac8e3 100644
--- a/telephony/java/android/telephony/CellIdentityWcdma.java
+++ b/telephony/java/android/telephony/CellIdentityWcdma.java
@@ -42,7 +42,7 @@
* @hide
*/
public CellIdentityWcdma() {
- super(TAG, TYPE_TDSCDMA, null, null, null, null);
+ super(TAG, CellInfo.TYPE_WCDMA, null, null, null, null);
mLac = Integer.MAX_VALUE;
mCid = Integer.MAX_VALUE;
mPsc = Integer.MAX_VALUE;
@@ -93,7 +93,7 @@
*/
public CellIdentityWcdma (int lac, int cid, int psc, int uarfcn,
String mccStr, String mncStr, String alphal, String alphas) {
- super(TAG, TYPE_WCDMA, mccStr, mncStr, alphal, alphas);
+ super(TAG, CellInfo.TYPE_WCDMA, mccStr, mncStr, alphal, alphas);
mLac = lac;
mCid = cid;
mPsc = psc;
@@ -227,7 +227,7 @@
@Override
public void writeToParcel(Parcel dest, int flags) {
if (DBG) log("writeToParcel(Parcel, int): " + toString());
- super.writeToParcel(dest, TYPE_WCDMA);
+ super.writeToParcel(dest, CellInfo.TYPE_WCDMA);
dest.writeInt(mLac);
dest.writeInt(mCid);
dest.writeInt(mPsc);
@@ -236,7 +236,7 @@
/** Construct from Parcel, type has already been processed */
private CellIdentityWcdma(Parcel in) {
- super(TAG, TYPE_WCDMA, in);
+ super(TAG, CellInfo.TYPE_WCDMA, in);
mLac = in.readInt();
mCid = in.readInt();
mPsc = in.readInt();
diff --git a/telephony/java/android/telephony/CellInfo.java b/telephony/java/android/telephony/CellInfo.java
index bffeb17..6b320f4 100644
--- a/telephony/java/android/telephony/CellInfo.java
+++ b/telephony/java/android/telephony/CellInfo.java
@@ -29,17 +29,43 @@
*/
public abstract class CellInfo implements Parcelable {
- // Type fields for parceling
- /** @hide */
- protected static final int TYPE_GSM = 1;
- /** @hide */
- protected static final int TYPE_CDMA = 2;
- /** @hide */
- protected static final int TYPE_LTE = 3;
- /** @hide */
- protected static final int TYPE_WCDMA = 4;
- /** @hide */
- protected static final int TYPE_TDCDMA = 5;
+ /**
+ * Cell identity type
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = "TYPE_", value = {TYPE_GSM, TYPE_CDMA, TYPE_LTE, TYPE_WCDMA, TYPE_TDSCDMA})
+ public @interface Type {}
+ /**
+ * Unknown cell identity type
+ * @hide
+ */
+ public static final int TYPE_UNKNOWN = 0;
+ /**
+ * GSM cell identity type
+ * @hide
+ */
+ public static final int TYPE_GSM = 1;
+ /**
+ * CDMA cell identity type
+ * @hide
+ */
+ public static final int TYPE_CDMA = 2;
+ /**
+ * LTE cell identity type
+ * @hide
+ */
+ public static final int TYPE_LTE = 3;
+ /**
+ * WCDMA cell identity type
+ * @hide
+ */
+ public static final int TYPE_WCDMA = 4;
+ /**
+ * TD-SCDMA cell identity type
+ * @hide
+ */
+ public static final int TYPE_TDSCDMA = 5;
// Type to distinguish where time stamp gets recorded.
@@ -161,6 +187,7 @@
public int getTimeStampType() {
return mTimeStampType;
}
+
/** @hide */
public void setTimeStampType(int timeStampType) {
if (timeStampType < TIMESTAMP_TYPE_UNKNOWN || timeStampType > TIMESTAMP_TYPE_JAVA_RIL) {
@@ -272,7 +299,7 @@
case TYPE_CDMA: return CellInfoCdma.createFromParcelBody(in);
case TYPE_LTE: return CellInfoLte.createFromParcelBody(in);
case TYPE_WCDMA: return CellInfoWcdma.createFromParcelBody(in);
- case TYPE_TDCDMA: return CellInfoTdscdma.createFromParcelBody(in);
+ case TYPE_TDSCDMA: return CellInfoTdscdma.createFromParcelBody(in);
default: throw new RuntimeException("Bad CellInfo Parcel");
}
}
diff --git a/telephony/java/android/telephony/CellInfoTdscdma.java b/telephony/java/android/telephony/CellInfoTdscdma.java
index 4fb1bce..40cadde 100644
--- a/telephony/java/android/telephony/CellInfoTdscdma.java
+++ b/telephony/java/android/telephony/CellInfoTdscdma.java
@@ -110,7 +110,7 @@
/** Implement the Parcelable interface */
@Override
public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags, TYPE_TDCDMA);
+ super.writeToParcel(dest, flags, TYPE_TDSCDMA);
mCellIdentityTdscdma.writeToParcel(dest, flags);
mCellSignalStrengthTdscdma.writeToParcel(dest, flags);
}