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
This commit is contained in:
Nathan Harold
2020-04-24 18:34:33 -07:00
parent f7d789b0ed
commit 3f7dfb8239
6 changed files with 10 additions and 0 deletions

View File

@@ -279,6 +279,7 @@ public final class CellIdentityCdma extends CellIdentity {
mLongitude = in.readInt();
mLatitude = in.readInt();
updateGlobalCellId();
if (DBG) log(toString());
}

View File

@@ -323,6 +323,7 @@ public final class CellIdentityGsm extends CellIdentity {
mBsic = in.readInt();
mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);
updateGlobalCellId();
if (DBG) log(toString());
}

View File

@@ -403,6 +403,8 @@ public final class CellIdentityLte extends CellIdentity {
mBandwidth = in.readInt();
mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);
mCsgInfo = in.readParcelable(null);
updateGlobalCellId();
if (DBG) log(toString());
}

View File

@@ -273,6 +273,8 @@ public final class CellIdentityNr extends CellIdentity {
mBands = in.createIntArray();
mNci = in.readLong();
mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);
updateGlobalCellId();
}
/** Implement the Parcelable interface */

View File

@@ -321,6 +321,8 @@ public final class CellIdentityTdscdma extends CellIdentity {
mUarfcn = in.readInt();
mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);
mCsgInfo = in.readParcelable(null);
updateGlobalCellId();
if (DBG) log(toString());
}

View File

@@ -336,6 +336,8 @@ public final class CellIdentityWcdma extends CellIdentity {
mUarfcn = in.readInt();
mAdditionalPlmns = (ArraySet<String>) in.readArraySet(null);
mCsgInfo = in.readParcelable(null);
updateGlobalCellId();
if (DBG) log(toString());
}