From 3f7dfb823912ec0406260c0da5a8ace13e6f7287 Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Fri, 24 Apr 2020 18:34:33 -0700 Subject: [PATCH] Update GlobalCellId during Un-parceling The Global Cell-ID is constructed from other fields in each CellIdentity. Currently, it is not stored during parceling. Thus, after a CellId is parceled and unparceled this value is being lost. Do a quick fix to update the global Cell ID during unparceling. A longer-term fix is to resolve the layering violations that create the situation where the global Cell ID is defined in the base class but manipulated in the derived classes. Fixes a broken unit test. Bug: 154955167 Test: atest ServiceStateTrackerTest#testRatRatchet Change-Id: I5c58322ebcec8886405e25e09754c7f154187efe --- telephony/java/android/telephony/CellIdentityCdma.java | 1 + telephony/java/android/telephony/CellIdentityGsm.java | 1 + telephony/java/android/telephony/CellIdentityLte.java | 2 ++ telephony/java/android/telephony/CellIdentityNr.java | 2 ++ telephony/java/android/telephony/CellIdentityTdscdma.java | 2 ++ telephony/java/android/telephony/CellIdentityWcdma.java | 2 ++ 6 files changed, 10 insertions(+) diff --git a/telephony/java/android/telephony/CellIdentityCdma.java b/telephony/java/android/telephony/CellIdentityCdma.java index f21277cdd83c4..68c833c37c99a 100644 --- a/telephony/java/android/telephony/CellIdentityCdma.java +++ b/telephony/java/android/telephony/CellIdentityCdma.java @@ -279,6 +279,7 @@ public final class CellIdentityCdma extends CellIdentity { mLongitude = in.readInt(); mLatitude = in.readInt(); + updateGlobalCellId(); if (DBG) log(toString()); } diff --git a/telephony/java/android/telephony/CellIdentityGsm.java b/telephony/java/android/telephony/CellIdentityGsm.java index 1a913105db2e3..849c613da748a 100644 --- a/telephony/java/android/telephony/CellIdentityGsm.java +++ b/telephony/java/android/telephony/CellIdentityGsm.java @@ -323,6 +323,7 @@ public final class CellIdentityGsm extends CellIdentity { mBsic = in.readInt(); mAdditionalPlmns = (ArraySet) in.readArraySet(null); + updateGlobalCellId(); if (DBG) log(toString()); } diff --git a/telephony/java/android/telephony/CellIdentityLte.java b/telephony/java/android/telephony/CellIdentityLte.java index 13a8273d64d48..1993550d52b88 100644 --- a/telephony/java/android/telephony/CellIdentityLte.java +++ b/telephony/java/android/telephony/CellIdentityLte.java @@ -403,6 +403,8 @@ public final class CellIdentityLte extends CellIdentity { mBandwidth = in.readInt(); mAdditionalPlmns = (ArraySet) in.readArraySet(null); mCsgInfo = in.readParcelable(null); + + updateGlobalCellId(); if (DBG) log(toString()); } diff --git a/telephony/java/android/telephony/CellIdentityNr.java b/telephony/java/android/telephony/CellIdentityNr.java index f0d878001bf43..8dd7bdd578417 100644 --- a/telephony/java/android/telephony/CellIdentityNr.java +++ b/telephony/java/android/telephony/CellIdentityNr.java @@ -273,6 +273,8 @@ public final class CellIdentityNr extends CellIdentity { mBands = in.createIntArray(); mNci = in.readLong(); mAdditionalPlmns = (ArraySet) in.readArraySet(null); + + updateGlobalCellId(); } /** Implement the Parcelable interface */ diff --git a/telephony/java/android/telephony/CellIdentityTdscdma.java b/telephony/java/android/telephony/CellIdentityTdscdma.java index 6dffe922ffd16..e74b70939d140 100644 --- a/telephony/java/android/telephony/CellIdentityTdscdma.java +++ b/telephony/java/android/telephony/CellIdentityTdscdma.java @@ -321,6 +321,8 @@ public final class CellIdentityTdscdma extends CellIdentity { mUarfcn = in.readInt(); mAdditionalPlmns = (ArraySet) in.readArraySet(null); mCsgInfo = in.readParcelable(null); + + updateGlobalCellId(); if (DBG) log(toString()); } diff --git a/telephony/java/android/telephony/CellIdentityWcdma.java b/telephony/java/android/telephony/CellIdentityWcdma.java index eab174ade3b7f..40cb27e951512 100644 --- a/telephony/java/android/telephony/CellIdentityWcdma.java +++ b/telephony/java/android/telephony/CellIdentityWcdma.java @@ -336,6 +336,8 @@ public final class CellIdentityWcdma extends CellIdentity { mUarfcn = in.readInt(); mAdditionalPlmns = (ArraySet) in.readArraySet(null); mCsgInfo = in.readParcelable(null); + + updateGlobalCellId(); if (DBG) log(toString()); }