Merge "Add NR to CellInfo"

This commit is contained in:
Sarah Chin
2019-11-23 01:05:04 +00:00
committed by Gerrit Code Review
3 changed files with 15 additions and 0 deletions

View File

@@ -61,6 +61,12 @@ public final class CellIdentityNr extends CellIdentity {
mNci = inRangeOrUnavailable(nci, 0, MAX_NCI);
}
/** @hide */
public CellIdentityNr(android.hardware.radio.V1_4.CellIdentityNr cid) {
this(cid.pci, cid.tac, cid.nrarfcn, cid.mcc, cid.mnc, cid.nci, cid.operatorNames.alphaLong,
cid.operatorNames.alphaShort);
}
/** @hide */
public CellIdentityNr sanitizeLocationInfo() {
return new CellIdentityNr(CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE,

View File

@@ -374,6 +374,7 @@ public abstract class CellInfo implements Parcelable {
case Info.hidl_discriminator.lte: return new CellInfoLte(ci, timeStamp);
case Info.hidl_discriminator.wcdma: return new CellInfoWcdma(ci, timeStamp);
case Info.hidl_discriminator.tdscdma: return new CellInfoTdscdma(ci, timeStamp);
case Info.hidl_discriminator.nr: return new CellInfoNr(ci, timeStamp);
default: return null;
}
}

View File

@@ -45,6 +45,14 @@ public final class CellInfoNr extends CellInfo {
mCellSignalStrength = other.mCellSignalStrength;
}
/** @hide */
public CellInfoNr(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) {
super(ci, timeStamp);
final android.hardware.radio.V1_4.CellInfoNr cil = ci.info.nr();
mCellIdentity = new CellIdentityNr(cil.cellidentity);
mCellSignalStrength = new CellSignalStrengthNr(cil.signalStrength);
}
/**
* @return a {@link CellIdentityNr} instance.
*/