Merge "Added bands from HAL 1.5" into rvc-dev
This commit is contained in:
@@ -25,6 +25,7 @@ import android.telephony.gsm.GsmCellLocation;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -54,6 +55,8 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
private final int mEarfcn;
|
private final int mEarfcn;
|
||||||
// cell bandwidth, in kHz
|
// cell bandwidth, in kHz
|
||||||
private final int mBandwidth;
|
private final int mBandwidth;
|
||||||
|
// cell bands
|
||||||
|
private final List<Integer> mBands;
|
||||||
|
|
||||||
// a list of additional PLMN-IDs reported for this cell
|
// a list of additional PLMN-IDs reported for this cell
|
||||||
private final ArraySet<String> mAdditionalPlmns;
|
private final ArraySet<String> mAdditionalPlmns;
|
||||||
@@ -70,6 +73,7 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
mPci = CellInfo.UNAVAILABLE;
|
mPci = CellInfo.UNAVAILABLE;
|
||||||
mTac = CellInfo.UNAVAILABLE;
|
mTac = CellInfo.UNAVAILABLE;
|
||||||
mEarfcn = CellInfo.UNAVAILABLE;
|
mEarfcn = CellInfo.UNAVAILABLE;
|
||||||
|
mBands = Collections.emptyList();
|
||||||
mBandwidth = CellInfo.UNAVAILABLE;
|
mBandwidth = CellInfo.UNAVAILABLE;
|
||||||
mAdditionalPlmns = new ArraySet<>();
|
mAdditionalPlmns = new ArraySet<>();
|
||||||
mCsgInfo = null;
|
mCsgInfo = null;
|
||||||
@@ -87,8 +91,9 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
||||||
public CellIdentityLte(int mcc, int mnc, int ci, int pci, int tac) {
|
public CellIdentityLte(int mcc, int mnc, int ci, int pci, int tac) {
|
||||||
this(ci, pci, tac, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, String.valueOf(mcc),
|
this(ci, pci, tac, CellInfo.UNAVAILABLE, Collections.emptyList(), CellInfo.UNAVAILABLE,
|
||||||
String.valueOf(mnc), null, null, new ArraySet<>(), null);
|
String.valueOf(mcc), String.valueOf(mnc), null, null, new ArraySet<>(),
|
||||||
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,7 +112,7 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public CellIdentityLte(int ci, int pci, int tac, int earfcn, int bandwidth,
|
public CellIdentityLte(int ci, int pci, int tac, int earfcn, List<Integer> bands, int bandwidth,
|
||||||
@Nullable String mccStr, @Nullable String mncStr, @Nullable String alphal,
|
@Nullable String mccStr, @Nullable String mncStr, @Nullable String alphal,
|
||||||
@Nullable String alphas, @NonNull Collection<String> additionalPlmns,
|
@Nullable String alphas, @NonNull Collection<String> additionalPlmns,
|
||||||
@Nullable ClosedSubscriberGroupInfo csgInfo) {
|
@Nullable ClosedSubscriberGroupInfo csgInfo) {
|
||||||
@@ -116,6 +121,7 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
mPci = inRangeOrUnavailable(pci, 0, MAX_PCI);
|
mPci = inRangeOrUnavailable(pci, 0, MAX_PCI);
|
||||||
mTac = inRangeOrUnavailable(tac, 0, MAX_TAC);
|
mTac = inRangeOrUnavailable(tac, 0, MAX_TAC);
|
||||||
mEarfcn = inRangeOrUnavailable(earfcn, 0, MAX_EARFCN);
|
mEarfcn = inRangeOrUnavailable(earfcn, 0, MAX_EARFCN);
|
||||||
|
mBands = new ArrayList<>(bands);
|
||||||
mBandwidth = inRangeOrUnavailable(bandwidth, 0, MAX_BANDWIDTH);
|
mBandwidth = inRangeOrUnavailable(bandwidth, 0, MAX_BANDWIDTH);
|
||||||
mAdditionalPlmns = new ArraySet<>(additionalPlmns.size());
|
mAdditionalPlmns = new ArraySet<>(additionalPlmns.size());
|
||||||
for (String plmn : additionalPlmns) {
|
for (String plmn : additionalPlmns) {
|
||||||
@@ -128,28 +134,28 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public CellIdentityLte(@NonNull 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,
|
this(cid.ci, cid.pci, cid.tac, cid.earfcn, Collections.emptyList(),
|
||||||
CellInfo.UNAVAILABLE, cid.mcc, cid.mnc, "", "", new ArraySet<>(), null);
|
CellInfo.UNAVAILABLE, cid.mcc, cid.mnc, "", "", new ArraySet<>(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public CellIdentityLte(@NonNull 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,
|
this(cid.base.ci, cid.base.pci, cid.base.tac, cid.base.earfcn, Collections.emptyList(),
|
||||||
cid.base.mcc, cid.base.mnc, cid.operatorNames.alphaLong,
|
cid.bandwidth, cid.base.mcc, cid.base.mnc, cid.operatorNames.alphaLong,
|
||||||
cid.operatorNames.alphaShort, new ArraySet<>(), null);
|
cid.operatorNames.alphaShort, new ArraySet<>(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public CellIdentityLte(@NonNull 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,
|
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.bands, cid.base.bandwidth, cid.base.base.mcc, cid.base.base.mnc,
|
||||||
cid.base.operatorNames.alphaLong, cid.base.operatorNames.alphaShort,
|
cid.base.operatorNames.alphaLong, cid.base.operatorNames.alphaShort,
|
||||||
cid.additionalPlmns, cid.optionalCsgInfo.csgInfo() != null
|
cid.additionalPlmns, cid.optionalCsgInfo.csgInfo() != null
|
||||||
? new ClosedSubscriberGroupInfo(cid.optionalCsgInfo.csgInfo()) : null);
|
? new ClosedSubscriberGroupInfo(cid.optionalCsgInfo.csgInfo()) : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CellIdentityLte(@NonNull CellIdentityLte cid) {
|
private CellIdentityLte(@NonNull CellIdentityLte cid) {
|
||||||
this(cid.mCi, cid.mPci, cid.mTac, cid.mEarfcn, cid.mBandwidth, cid.mMccStr,
|
this(cid.mCi, cid.mPci, cid.mTac, cid.mEarfcn, cid.mBands, cid.mBandwidth, cid.mMccStr,
|
||||||
cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns, cid.mCsgInfo);
|
cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns, cid.mCsgInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +163,7 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
@Override
|
@Override
|
||||||
public @NonNull CellIdentityLte sanitizeLocationInfo() {
|
public @NonNull CellIdentityLte sanitizeLocationInfo() {
|
||||||
return new CellIdentityLte(CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE,
|
return new CellIdentityLte(CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE,
|
||||||
CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE,
|
CellInfo.UNAVAILABLE, mBands, CellInfo.UNAVAILABLE,
|
||||||
mMccStr, mMncStr, mAlphaLong, mAlphaShort, mAdditionalPlmns, null);
|
mMccStr, mMncStr, mAlphaLong, mAlphaShort, mAdditionalPlmns, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,8 +232,7 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public List<Integer> getBands() {
|
public List<Integer> getBands() {
|
||||||
// Todo: Add actual support
|
return Collections.unmodifiableList(mBands);
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -343,6 +348,7 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
.append(" mPci=").append(mPci)
|
.append(" mPci=").append(mPci)
|
||||||
.append(" mTac=").append(mTac)
|
.append(" mTac=").append(mTac)
|
||||||
.append(" mEarfcn=").append(mEarfcn)
|
.append(" mEarfcn=").append(mEarfcn)
|
||||||
|
.append(" mBands=").append(mBands)
|
||||||
.append(" mBandwidth=").append(mBandwidth)
|
.append(" mBandwidth=").append(mBandwidth)
|
||||||
.append(" mMcc=").append(mMccStr)
|
.append(" mMcc=").append(mMccStr)
|
||||||
.append(" mMnc=").append(mMncStr)
|
.append(" mMnc=").append(mMncStr)
|
||||||
@@ -362,6 +368,7 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
dest.writeInt(mPci);
|
dest.writeInt(mPci);
|
||||||
dest.writeInt(mTac);
|
dest.writeInt(mTac);
|
||||||
dest.writeInt(mEarfcn);
|
dest.writeInt(mEarfcn);
|
||||||
|
dest.writeList(mBands);
|
||||||
dest.writeInt(mBandwidth);
|
dest.writeInt(mBandwidth);
|
||||||
dest.writeArraySet(mAdditionalPlmns);
|
dest.writeArraySet(mAdditionalPlmns);
|
||||||
dest.writeParcelable(mCsgInfo, flags);
|
dest.writeParcelable(mCsgInfo, flags);
|
||||||
@@ -374,6 +381,7 @@ public final class CellIdentityLte extends CellIdentity {
|
|||||||
mPci = in.readInt();
|
mPci = in.readInt();
|
||||||
mTac = in.readInt();
|
mTac = in.readInt();
|
||||||
mEarfcn = in.readInt();
|
mEarfcn = in.readInt();
|
||||||
|
mBands = in.readArrayList(null);
|
||||||
mBandwidth = in.readInt();
|
mBandwidth = in.readInt();
|
||||||
mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);
|
mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);
|
||||||
mCsgInfo = in.readParcelable(null);
|
mCsgInfo = in.readParcelable(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user