summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--telephony/java/android/telephony/CellIdentity.java6
-rw-r--r--telephony/java/android/telephony/CellIdentityCdma.java13
-rw-r--r--telephony/java/android/telephony/CellIdentityGsm.java24
-rw-r--r--telephony/java/android/telephony/CellIdentityLte.java25
-rw-r--r--telephony/java/android/telephony/CellIdentityNr.java16
-rw-r--r--telephony/java/android/telephony/CellIdentityTdscdma.java24
-rw-r--r--telephony/java/android/telephony/CellIdentityWcdma.java25
7 files changed, 81 insertions, 52 deletions
diff --git a/telephony/java/android/telephony/CellIdentity.java b/telephony/java/android/telephony/CellIdentity.java
index 399b1a4f25de..0c2f1f325793 100644
--- a/telephony/java/android/telephony/CellIdentity.java
+++ b/telephony/java/android/telephony/CellIdentity.java
@@ -16,8 +16,6 @@
package android.telephony;
-import com.android.telephony.Rlog;
-
import android.annotation.CallSuper;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -71,8 +69,8 @@ public abstract class CellIdentity implements Parcelable {
protected String mAlphaShort;
/** @hide */
- protected CellIdentity(String tag, int type, String mcc, String mnc, String alphal,
- String alphas) {
+ protected CellIdentity(@Nullable String tag, int type, @Nullable String mcc,
+ @Nullable String mnc, @Nullable String alphal, @Nullable String alphas) {
mTag = tag;
mType = type;
diff --git a/telephony/java/android/telephony/CellIdentityCdma.java b/telephony/java/android/telephony/CellIdentityCdma.java
index 1a6bf33cec71..e220b07d703a 100644
--- a/telephony/java/android/telephony/CellIdentityCdma.java
+++ b/telephony/java/android/telephony/CellIdentityCdma.java
@@ -17,6 +17,7 @@
package android.telephony;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.Parcel;
import android.telephony.cdma.CdmaCellLocation;
@@ -90,8 +91,8 @@ public final class CellIdentityCdma extends CellIdentity {
*
* @hide
*/
- public CellIdentityCdma(
- int nid, int sid, int bid, int lon, int lat, String alphal, String alphas) {
+ public CellIdentityCdma(int nid, int sid, int bid, int lon, int lat,
+ @Nullable String alphal, @Nullable String alphas) {
super(TAG, CellInfo.TYPE_CDMA, null, null, alphal, alphas);
mNetworkId = inRangeOrUnavailable(nid, 0, NETWORK_ID_MAX);
mSystemId = inRangeOrUnavailable(sid, 0, SYSTEM_ID_MAX);
@@ -108,22 +109,22 @@ public final class CellIdentityCdma extends CellIdentity {
}
/** @hide */
- public CellIdentityCdma(android.hardware.radio.V1_0.CellIdentityCdma cid) {
+ public CellIdentityCdma(@NonNull android.hardware.radio.V1_0.CellIdentityCdma cid) {
this(cid.networkId, cid.systemId, cid.baseStationId, cid.longitude, cid.latitude, "", "");
}
/** @hide */
- public CellIdentityCdma(android.hardware.radio.V1_2.CellIdentityCdma cid) {
+ public CellIdentityCdma(@NonNull android.hardware.radio.V1_2.CellIdentityCdma cid) {
this(cid.base.networkId, cid.base.systemId, cid.base.baseStationId, cid.base.longitude,
cid.base.latitude, cid.operatorNames.alphaLong, cid.operatorNames.alphaShort);
}
- private CellIdentityCdma(CellIdentityCdma cid) {
+ private CellIdentityCdma(@NonNull CellIdentityCdma cid) {
this(cid.mNetworkId, cid.mSystemId, cid.mBasestationId, cid.mLongitude, cid.mLatitude,
cid.mAlphaLong, cid.mAlphaShort);
}
- CellIdentityCdma copy() {
+ @NonNull CellIdentityCdma copy() {
return new CellIdentityCdma(this);
}
diff --git a/telephony/java/android/telephony/CellIdentityGsm.java b/telephony/java/android/telephony/CellIdentityGsm.java
index dc73cbf735b0..9f2537c7ed10 100644
--- a/telephony/java/android/telephony/CellIdentityGsm.java
+++ b/telephony/java/android/telephony/CellIdentityGsm.java
@@ -23,6 +23,7 @@ import android.os.Parcel;
import android.telephony.gsm.GsmCellLocation;
import android.text.TextUtils;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
@@ -78,26 +79,31 @@ public final class CellIdentityGsm extends CellIdentity {
*
* @hide
*/
- public CellIdentityGsm(int lac, int cid, int arfcn, int bsic, String mccStr,
- String mncStr, String alphal, String alphas,
- List<String> additionalPlmns) {
+ public CellIdentityGsm(int lac, int cid, int arfcn, int bsic, @Nullable String mccStr,
+ @Nullable String mncStr, @Nullable String alphal, @Nullable String alphas,
+ @NonNull List<String> additionalPlmns) {
super(TAG, CellInfo.TYPE_GSM, mccStr, mncStr, alphal, alphas);
mLac = inRangeOrUnavailable(lac, 0, MAX_LAC);
mCid = inRangeOrUnavailable(cid, 0, MAX_CID);
mArfcn = inRangeOrUnavailable(arfcn, 0, MAX_ARFCN);
mBsic = inRangeOrUnavailable(bsic, 0, MAX_BSIC);
- mAdditionalPlmns = additionalPlmns;
+ mAdditionalPlmns = new ArrayList<>(additionalPlmns.size());
+ for (String plmn : additionalPlmns) {
+ if (isValidPlmn(plmn)) {
+ mAdditionalPlmns.add(plmn);
+ }
+ }
}
/** @hide */
- public CellIdentityGsm(android.hardware.radio.V1_0.CellIdentityGsm cid) {
+ public CellIdentityGsm(@NonNull android.hardware.radio.V1_0.CellIdentityGsm cid) {
this(cid.lac, cid.cid, cid.arfcn,
cid.bsic == (byte) 0xFF ? CellInfo.UNAVAILABLE : cid.bsic,
cid.mcc, cid.mnc, "", "", Collections.emptyList());
}
/** @hide */
- public CellIdentityGsm(android.hardware.radio.V1_2.CellIdentityGsm cid) {
+ public CellIdentityGsm(@NonNull android.hardware.radio.V1_2.CellIdentityGsm cid) {
this(cid.base.lac, cid.base.cid, cid.base.arfcn,
cid.base.bsic == (byte) 0xFF ? CellInfo.UNAVAILABLE : cid.base.bsic, cid.base.mcc,
cid.base.mnc, cid.operatorNames.alphaLong, cid.operatorNames.alphaShort,
@@ -105,7 +111,7 @@ public final class CellIdentityGsm extends CellIdentity {
}
/** @hide */
- public CellIdentityGsm(android.hardware.radio.V1_5.CellIdentityGsm cid) {
+ public CellIdentityGsm(@NonNull android.hardware.radio.V1_5.CellIdentityGsm cid) {
this(cid.base.base.lac, cid.base.base.cid, cid.base.base.arfcn,
cid.base.base.bsic == (byte) 0xFF ? CellInfo.UNAVAILABLE
: cid.base.base.bsic, cid.base.base.mcc,
@@ -113,12 +119,12 @@ public final class CellIdentityGsm extends CellIdentity {
cid.base.operatorNames.alphaShort, cid.additionalPlmns);
}
- private CellIdentityGsm(CellIdentityGsm cid) {
+ private CellIdentityGsm(@NonNull CellIdentityGsm cid) {
this(cid.mLac, cid.mCid, cid.mArfcn, cid.mBsic, cid.mMccStr,
cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns);
}
- CellIdentityGsm copy() {
+ @NonNull CellIdentityGsm copy() {
return new CellIdentityGsm(this);
}
diff --git a/telephony/java/android/telephony/CellIdentityLte.java b/telephony/java/android/telephony/CellIdentityLte.java
index cf8fe6a3c345..a194ae35216c 100644
--- a/telephony/java/android/telephony/CellIdentityLte.java
+++ b/telephony/java/android/telephony/CellIdentityLte.java
@@ -24,6 +24,7 @@ import android.os.Parcel;
import android.telephony.gsm.GsmCellLocation;
import android.text.TextUtils;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
@@ -104,34 +105,40 @@ public final class CellIdentityLte extends CellIdentity {
*
* @hide
*/
- public CellIdentityLte(int ci, int pci, int tac, int earfcn, int bandwidth, String mccStr,
- String mncStr, String alphal, String alphas, List<String> additionalPlmns,
- ClosedSubscriberGroupInfo csgInfo) {
+ public CellIdentityLte(int ci, int pci, int tac, int earfcn, int bandwidth,
+ @Nullable String mccStr, @Nullable String mncStr, @Nullable String alphal,
+ @Nullable String alphas, @NonNull List<String> additionalPlmns,
+ @Nullable ClosedSubscriberGroupInfo csgInfo) {
super(TAG, CellInfo.TYPE_LTE, mccStr, mncStr, alphal, alphas);
mCi = inRangeOrUnavailable(ci, 0, MAX_CI);
mPci = inRangeOrUnavailable(pci, 0, MAX_PCI);
mTac = inRangeOrUnavailable(tac, 0, MAX_TAC);
mEarfcn = inRangeOrUnavailable(earfcn, 0, MAX_EARFCN);
mBandwidth = inRangeOrUnavailable(bandwidth, 0, MAX_BANDWIDTH);
- mAdditionalPlmns = additionalPlmns;
+ mAdditionalPlmns = new ArrayList<>(additionalPlmns.size());
+ for (String plmn : additionalPlmns) {
+ if (isValidPlmn(plmn)) {
+ mAdditionalPlmns.add(plmn);
+ }
+ }
mCsgInfo = csgInfo;
}
/** @hide */
- public CellIdentityLte(android.hardware.radio.V1_0.CellIdentityLte cid) {
+ public CellIdentityLte(@NonNull android.hardware.radio.V1_0.CellIdentityLte cid) {
this(cid.ci, cid.pci, cid.tac, cid.earfcn,
CellInfo.UNAVAILABLE, cid.mcc, cid.mnc, "", "", Collections.emptyList(), null);
}
/** @hide */
- public CellIdentityLte(android.hardware.radio.V1_2.CellIdentityLte cid) {
+ public CellIdentityLte(@NonNull android.hardware.radio.V1_2.CellIdentityLte cid) {
this(cid.base.ci, cid.base.pci, cid.base.tac, cid.base.earfcn, cid.bandwidth,
cid.base.mcc, cid.base.mnc, cid.operatorNames.alphaLong,
cid.operatorNames.alphaShort, Collections.emptyList(), null);
}
/** @hide */
- public CellIdentityLte(android.hardware.radio.V1_5.CellIdentityLte cid) {
+ public CellIdentityLte(@NonNull android.hardware.radio.V1_5.CellIdentityLte cid) {
this(cid.base.base.ci, cid.base.base.pci, cid.base.base.tac, cid.base.base.earfcn,
cid.base.bandwidth, cid.base.base.mcc, cid.base.base.mnc,
cid.base.operatorNames.alphaLong, cid.base.operatorNames.alphaShort,
@@ -139,7 +146,7 @@ public final class CellIdentityLte extends CellIdentity {
? new ClosedSubscriberGroupInfo(cid.optionalCsgInfo.csgInfo()) : null);
}
- private CellIdentityLte(CellIdentityLte cid) {
+ private CellIdentityLte(@NonNull CellIdentityLte cid) {
this(cid.mCi, cid.mPci, cid.mTac, cid.mEarfcn, cid.mBandwidth, cid.mMccStr,
cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns, cid.mCsgInfo);
}
@@ -152,7 +159,7 @@ public final class CellIdentityLte extends CellIdentity {
mMccStr, mMncStr, mAlphaLong, mAlphaShort, mAdditionalPlmns, null);
}
- CellIdentityLte copy() {
+ @NonNull CellIdentityLte copy() {
return new CellIdentityLte(this);
}
diff --git a/telephony/java/android/telephony/CellIdentityNr.java b/telephony/java/android/telephony/CellIdentityNr.java
index d4f181fc735a..a0ef5aa2feae 100644
--- a/telephony/java/android/telephony/CellIdentityNr.java
+++ b/telephony/java/android/telephony/CellIdentityNr.java
@@ -64,26 +64,32 @@ public final class CellIdentityNr extends CellIdentity {
* @hide
*/
public CellIdentityNr(int pci, int tac, int nrArfcn, @NgranBand List<Integer> bands,
- String mccStr, String mncStr, long nci, String alphal, String alphas,
- List<String> additionalPlmns) {
+ @Nullable String mccStr, @Nullable String mncStr, long nci,
+ @Nullable String alphal, @Nullable String alphas,
+ @NonNull List<String> additionalPlmns) {
super(TAG, CellInfo.TYPE_NR, mccStr, mncStr, alphal, alphas);
mPci = inRangeOrUnavailable(pci, 0, MAX_PCI);
mTac = inRangeOrUnavailable(tac, 0, MAX_TAC);
mNrArfcn = inRangeOrUnavailable(nrArfcn, 0, MAX_NRARFCN);
mBands = new ArrayList<>(bands);
mNci = inRangeOrUnavailable(nci, 0, MAX_NCI);
- mAdditionalPlmns = new ArrayList<>(additionalPlmns);
+ mAdditionalPlmns = new ArrayList<>(additionalPlmns.size());
+ for (String plmn : additionalPlmns) {
+ if (isValidPlmn(plmn)) {
+ mAdditionalPlmns.add(plmn);
+ }
+ }
}
/** @hide */
- public CellIdentityNr(android.hardware.radio.V1_4.CellIdentityNr cid) {
+ public CellIdentityNr(@NonNull android.hardware.radio.V1_4.CellIdentityNr cid) {
this(cid.pci, cid.tac, cid.nrarfcn, Collections.emptyList(), cid.mcc, cid.mnc, cid.nci,
cid.operatorNames.alphaLong, cid.operatorNames.alphaShort,
Collections.emptyList());
}
/** @hide */
- public CellIdentityNr(android.hardware.radio.V1_5.CellIdentityNr cid) {
+ public CellIdentityNr(@NonNull android.hardware.radio.V1_5.CellIdentityNr cid) {
this(cid.base.pci, cid.base.tac, cid.base.nrarfcn, cid.bands, cid.base.mcc, cid.base.mnc,
cid.base.nci, cid.base.operatorNames.alphaLong,
cid.base.operatorNames.alphaShort, cid.additionalPlmns);
diff --git a/telephony/java/android/telephony/CellIdentityTdscdma.java b/telephony/java/android/telephony/CellIdentityTdscdma.java
index 2ff351c17e9a..531487a313d9 100644
--- a/telephony/java/android/telephony/CellIdentityTdscdma.java
+++ b/telephony/java/android/telephony/CellIdentityTdscdma.java
@@ -21,6 +21,7 @@ import android.annotation.Nullable;
import android.os.Parcel;
import android.telephony.gsm.GsmCellLocation;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
@@ -82,39 +83,44 @@ public final class CellIdentityTdscdma extends CellIdentity {
*
* @hide
*/
- public CellIdentityTdscdma(String mcc, String mnc, int lac, int cid, int cpid, int uarfcn,
- String alphal, String alphas, @NonNull List<String> additionalPlmns,
- ClosedSubscriberGroupInfo csgInfo) {
+ public CellIdentityTdscdma(@Nullable String mcc, @Nullable String mnc, int lac, int cid,
+ int cpid, int uarfcn, @Nullable String alphal, @Nullable String alphas,
+ @NonNull List<String> additionalPlmns, @Nullable ClosedSubscriberGroupInfo csgInfo) {
super(TAG, CellInfo.TYPE_TDSCDMA, mcc, mnc, alphal, alphas);
mLac = inRangeOrUnavailable(lac, 0, MAX_LAC);
mCid = inRangeOrUnavailable(cid, 0, MAX_CID);
mCpid = inRangeOrUnavailable(cpid, 0, MAX_CPID);
mUarfcn = inRangeOrUnavailable(uarfcn, 0, MAX_UARFCN);
- mAdditionalPlmns = additionalPlmns;
+ mAdditionalPlmns = new ArrayList<>(additionalPlmns.size());
+ for (String plmn : additionalPlmns) {
+ if (isValidPlmn(plmn)) {
+ mAdditionalPlmns.add(plmn);
+ }
+ }
mCsgInfo = csgInfo;
}
- private CellIdentityTdscdma(CellIdentityTdscdma cid) {
+ private CellIdentityTdscdma(@NonNull CellIdentityTdscdma cid) {
this(cid.mMccStr, cid.mMncStr, cid.mLac, cid.mCid,
cid.mCpid, cid.mUarfcn, cid.mAlphaLong,
cid.mAlphaShort, cid.mAdditionalPlmns, cid.mCsgInfo);
}
/** @hide */
- public CellIdentityTdscdma(android.hardware.radio.V1_0.CellIdentityTdscdma cid) {
+ public CellIdentityTdscdma(@NonNull android.hardware.radio.V1_0.CellIdentityTdscdma cid) {
this(cid.mcc, cid.mnc, cid.lac, cid.cid, cid.cpid, CellInfo.UNAVAILABLE, "", "",
Collections.emptyList(), null);
}
/** @hide */
- public CellIdentityTdscdma(android.hardware.radio.V1_2.CellIdentityTdscdma cid) {
+ public CellIdentityTdscdma(@NonNull android.hardware.radio.V1_2.CellIdentityTdscdma cid) {
this(cid.base.mcc, cid.base.mnc, cid.base.lac, cid.base.cid, cid.base.cpid,
cid.uarfcn, cid.operatorNames.alphaLong, cid.operatorNames.alphaShort,
Collections.emptyList(), null);
}
/** @hide */
- public CellIdentityTdscdma(android.hardware.radio.V1_5.CellIdentityTdscdma cid) {
+ public CellIdentityTdscdma(@NonNull android.hardware.radio.V1_5.CellIdentityTdscdma cid) {
this(cid.base.base.mcc, cid.base.base.mnc, cid.base.base.lac, cid.base.base.cid,
cid.base.base.cpid, cid.base.uarfcn, cid.base.operatorNames.alphaLong,
cid.base.operatorNames.alphaShort,
@@ -130,7 +136,7 @@ public final class CellIdentityTdscdma extends CellIdentity {
mAdditionalPlmns, null);
}
- CellIdentityTdscdma copy() {
+ @NonNull CellIdentityTdscdma copy() {
return new CellIdentityTdscdma(this);
}
diff --git a/telephony/java/android/telephony/CellIdentityWcdma.java b/telephony/java/android/telephony/CellIdentityWcdma.java
index 9be42a17677b..15e491b66575 100644
--- a/telephony/java/android/telephony/CellIdentityWcdma.java
+++ b/telephony/java/android/telephony/CellIdentityWcdma.java
@@ -23,6 +23,7 @@ import android.os.Parcel;
import android.telephony.gsm.GsmCellLocation;
import android.text.TextUtils;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
@@ -83,34 +84,38 @@ public final class CellIdentityWcdma extends CellIdentity {
*
* @hide
*/
- public CellIdentityWcdma (int lac, int cid, int psc, int uarfcn,
- String mccStr, String mncStr, String alphal, String alphas,
- @NonNull List<String> additionalPlmns,
- @Nullable ClosedSubscriberGroupInfo csgInfo) {
+ public CellIdentityWcdma(int lac, int cid, int psc, int uarfcn, @Nullable String mccStr,
+ @Nullable String mncStr, @Nullable String alphal, @Nullable String alphas,
+ @NonNull List<String> additionalPlmns, @Nullable ClosedSubscriberGroupInfo csgInfo) {
super(TAG, CellInfo.TYPE_WCDMA, mccStr, mncStr, alphal, alphas);
mLac = inRangeOrUnavailable(lac, 0, MAX_LAC);
mCid = inRangeOrUnavailable(cid, 0, MAX_CID);
mPsc = inRangeOrUnavailable(psc, 0, MAX_PSC);
mUarfcn = inRangeOrUnavailable(uarfcn, 0, MAX_UARFCN);
- mAdditionalPlmns = additionalPlmns;
+ mAdditionalPlmns = new ArrayList<>(additionalPlmns.size());
+ for (String plmn : additionalPlmns) {
+ if (isValidPlmn(plmn)) {
+ mAdditionalPlmns.add(plmn);
+ }
+ }
mCsgInfo = csgInfo;
}
/** @hide */
- public CellIdentityWcdma(android.hardware.radio.V1_0.CellIdentityWcdma cid) {
+ public CellIdentityWcdma(@NonNull android.hardware.radio.V1_0.CellIdentityWcdma cid) {
this(cid.lac, cid.cid, cid.psc, cid.uarfcn, cid.mcc, cid.mnc, "", "",
Collections.emptyList(), null);
}
/** @hide */
- public CellIdentityWcdma(android.hardware.radio.V1_2.CellIdentityWcdma cid) {
+ public CellIdentityWcdma(@NonNull android.hardware.radio.V1_2.CellIdentityWcdma cid) {
this(cid.base.lac, cid.base.cid, cid.base.psc, cid.base.uarfcn,
cid.base.mcc, cid.base.mnc, cid.operatorNames.alphaLong,
cid.operatorNames.alphaShort, Collections.emptyList(), null);
}
/** @hide */
- public CellIdentityWcdma(android.hardware.radio.V1_5.CellIdentityWcdma cid) {
+ public CellIdentityWcdma(@NonNull android.hardware.radio.V1_5.CellIdentityWcdma cid) {
this(cid.base.base.lac, cid.base.base.cid, cid.base.base.psc, cid.base.base.uarfcn,
cid.base.base.mcc, cid.base.base.mnc, cid.base.operatorNames.alphaLong,
cid.base.operatorNames.alphaShort, cid.additionalPlmns,
@@ -118,7 +123,7 @@ public final class CellIdentityWcdma extends CellIdentity {
? new ClosedSubscriberGroupInfo(cid.optionalCsgInfo.csgInfo()) : null);
}
- private CellIdentityWcdma(CellIdentityWcdma cid) {
+ private CellIdentityWcdma(@NonNull CellIdentityWcdma cid) {
this(cid.mLac, cid.mCid, cid.mPsc, cid.mUarfcn, cid.mMccStr,
cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns, cid.mCsgInfo);
}
@@ -131,7 +136,7 @@ public final class CellIdentityWcdma extends CellIdentity {
mAlphaLong, mAlphaShort, mAdditionalPlmns, null);
}
- CellIdentityWcdma copy() {
+ @NonNull CellIdentityWcdma copy() {
return new CellIdentityWcdma(this);
}