Merge "Fixups for Barring Info" am: 84e81127b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2251745 Change-Id: Ib8980e470197268b188a2d769c466cd798a677ad Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -2572,33 +2572,39 @@ 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) {
|
||||||
mBarringInfo.set(phoneId, barringInfo);
|
loge("Received null BarringInfo for subId=" + subId + ", phoneId=" + phoneId);
|
||||||
// Barring info is non-null
|
mBarringInfo.set(phoneId, new BarringInfo());
|
||||||
BarringInfo biNoLocation = barringInfo.createLocationInfoSanitizedCopy();
|
return;
|
||||||
if (VDBG) log("listen: call onBarringInfoChanged=" + barringInfo);
|
}
|
||||||
for (Record r : mRecords) {
|
if (barringInfo.equals(mBarringInfo.get(phoneId))) {
|
||||||
if (r.matchTelephonyCallbackEvent(
|
if (VDBG) log("Ignoring duplicate barring info.");
|
||||||
TelephonyCallback.EVENT_BARRING_INFO_CHANGED)
|
return;
|
||||||
&& idMatch(r, subId, phoneId)) {
|
}
|
||||||
try {
|
mBarringInfo.set(phoneId, barringInfo);
|
||||||
if (DBG_LOC) {
|
// Barring info is non-null
|
||||||
log("notifyBarringInfo: mBarringInfo="
|
BarringInfo biNoLocation = barringInfo.createLocationInfoSanitizedCopy();
|
||||||
+ barringInfo + " r=" + r);
|
if (VDBG) log("listen: call onBarringInfoChanged=" + barringInfo);
|
||||||
}
|
for (Record r : mRecords) {
|
||||||
r.callback.onBarringInfoChanged(
|
if (r.matchTelephonyCallbackEvent(
|
||||||
checkFineLocationAccess(r, Build.VERSION_CODES.BASE)
|
TelephonyCallback.EVENT_BARRING_INFO_CHANGED)
|
||||||
? barringInfo : biNoLocation);
|
&& idMatch(r, subId, phoneId)) {
|
||||||
} catch (RemoteException ex) {
|
try {
|
||||||
mRemoveList.add(r.binder);
|
if (DBG_LOC) {
|
||||||
|
log("notifyBarringInfo: mBarringInfo="
|
||||||
|
+ barringInfo + " r=" + r);
|
||||||
}
|
}
|
||||||
|
r.callback.onBarringInfoChanged(
|
||||||
|
checkFineLocationAccess(r, Build.VERSION_CODES.BASE)
|
||||||
|
? barringInfo : biNoLocation);
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
mRemoveList.add(r.binder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user