From 5f8ab16877c1bfb20891a43a721edd72721f8c04 Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Fri, 31 Jan 2020 15:47:35 -0800 Subject: [PATCH] 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 --- telephony/java/android/telephony/BarringInfo.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telephony/java/android/telephony/BarringInfo.java b/telephony/java/android/telephony/BarringInfo.java index 9baa66fcd87e8..9ba707d7ffcad 100644 --- a/telephony/java/android/telephony/BarringInfo.java +++ b/telephony/java/android/telephony/BarringInfo.java @@ -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); }