Skip sanitizing location info for Null Barring CID

If the CellIdentity in BarringInfo is null, then it
doesn't need to be location-info sanitized before
being provided.

Bug: 148695512
Test: atest CarrierApiTest
Change-Id: I8db108a91bcfcdefb48ff3779d972e126bc1d7d2
This commit is contained in:
Nathan Harold
2020-01-31 15:47:35 -08:00
parent 5a1680ded1
commit 5f8ab16877

View File

@@ -321,6 +321,9 @@ public final class BarringInfo implements Parcelable {
/** @hide */
@SystemApi
public @NonNull BarringInfo createLocationInfoSanitizedCopy() {
// The only thing that would need sanitizing is the CellIdentity
if (mCellIdentity == null) return this;
return new BarringInfo(mCellIdentity.sanitizeLocationInfo(), mBarringServiceInfos);
}