From 69e53926f2c56263e815965242fc0625245e09e2 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Thu, 27 Aug 2020 11:11:34 -0700 Subject: [PATCH] Add ncid to CellLocation in CellIdentityNr Update GsmCellLocation documentation for NR case. Since the NR cell ID is 36 bits and can't fit into the 32-bit field in GsmCellLocation, return -1 for the CID. Test: atest CellIdentityNrTest Bug: 166514842 Change-Id: Ib894e83900b590c11221502ad039781cea5b571c --- telephony/java/android/telephony/CellIdentityNr.java | 6 +++++- telephony/java/android/telephony/gsm/GsmCellLocation.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/telephony/java/android/telephony/CellIdentityNr.java b/telephony/java/android/telephony/CellIdentityNr.java index 1794ac5b723a3..26c8d7991b5e4 100644 --- a/telephony/java/android/telephony/CellIdentityNr.java +++ b/telephony/java/android/telephony/CellIdentityNr.java @@ -126,7 +126,11 @@ public final class CellIdentityNr extends CellIdentity { @NonNull @Override public CellLocation asCellLocation() { - return new GsmCellLocation(); + GsmCellLocation cl = new GsmCellLocation(); + int tac = mTac != CellInfo.UNAVAILABLE ? mTac : -1; + cl.setLacAndCid(tac, -1); + cl.setPsc(0); + return cl; } @Override diff --git a/telephony/java/android/telephony/gsm/GsmCellLocation.java b/telephony/java/android/telephony/gsm/GsmCellLocation.java index 30cea0e6dd597..bc8ee1dd93594 100644 --- a/telephony/java/android/telephony/gsm/GsmCellLocation.java +++ b/telephony/java/android/telephony/gsm/GsmCellLocation.java @@ -55,7 +55,7 @@ public class GsmCellLocation extends CellLocation { } /** - * @return gsm cell id, -1 if unknown, 0xffff max legal value + * @return gsm cell id, -1 if unknown or invalid, 0xffff max legal value */ public int getCid() { return mCid;