Merge "Fixups for Barring Info" am: 84e81127b0 am: 04e59a1d10

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2251745

Change-Id: I634d1baf5ea25676a6157d2701e620a8c90e8fc4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Nathan Harold
2022-10-20 17:54:03 +00:00
committed by Automerger Merge Worker

View File

@@ -2572,14 +2572,21 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
if (!checkNotifyPermission("notifyBarringInfo()")) { if (!checkNotifyPermission("notifyBarringInfo()")) {
return; return;
} }
if (barringInfo == null) { if (!validatePhoneId(phoneId)) {
log("Received null BarringInfo for subId=" + subId + ", phoneId=" + phoneId); loge("Received invalid phoneId for BarringInfo = " + phoneId);
mBarringInfo.set(phoneId, new BarringInfo());
return; return;
} }
synchronized (mRecords) { synchronized (mRecords) {
if (validatePhoneId(phoneId)) { if (barringInfo == null) {
loge("Received null BarringInfo for subId=" + subId + ", phoneId=" + phoneId);
mBarringInfo.set(phoneId, new BarringInfo());
return;
}
if (barringInfo.equals(mBarringInfo.get(phoneId))) {
if (VDBG) log("Ignoring duplicate barring info.");
return;
}
mBarringInfo.set(phoneId, barringInfo); mBarringInfo.set(phoneId, barringInfo);
// Barring info is non-null // Barring info is non-null
BarringInfo biNoLocation = barringInfo.createLocationInfoSanitizedCopy(); BarringInfo biNoLocation = barringInfo.createLocationInfoSanitizedCopy();
@@ -2601,7 +2608,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
} }
} }
} }
}
handleRemoveListLocked(); handleRemoveListLocked();
} }
} }