Added permission check for notifying subscription changed

Added permission check for notifying subscription changed
event.

This is same as the reverted ag/20813431.

Bug: 239607619
Test: Manual
Change-Id: I0103d62a5adcfb4f5bdcd05bb236029dd04acdc8
This commit is contained in:
Jack Yu
2022-12-22 03:23:32 -08:00
parent dbed72c364
commit f4af1f713a

View File

@@ -1000,6 +1000,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
@Override
public void notifySubscriptionInfoChanged() {
if (VDBG) log("notifySubscriptionInfoChanged:");
if (!checkNotifyPermission("notifySubscriptionInfoChanged()")) {
return;
}
synchronized (mRecords) {
if (!mHasNotifySubscriptionInfoChangedOccurred) {
log("notifySubscriptionInfoChanged: first invocation mRecords.size="
@@ -1026,6 +1030,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
@Override
public void notifyOpportunisticSubscriptionInfoChanged() {
if (VDBG) log("notifyOpptSubscriptionInfoChanged:");
if (!checkNotifyPermission("notifyOpportunisticSubscriptionInfoChanged()")) {
return;
}
synchronized (mRecords) {
if (!mHasNotifyOpportunisticSubscriptionInfoChangedOccurred) {
log("notifyOpptSubscriptionInfoChanged: first invocation mRecords.size="