Have proper permission check in getConfigForSubId
getConfigForSubId also needs to check permission from AppOps, but
it's not. This change fixes it. Within this commit, PhoneGlobals#
getCarrierConfigForSubId always passes its own packageName as
when calling getConfigForSubId, so further change is needed (pass
external callingPackage or clear calling identity).
Bug: 73136824
Test: regression
Change-Id: Icfefd2cc17633304a397d573a9e010385c5799c8
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index d4da7fe..b1e061f 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -437,7 +437,7 @@
}
public PersistableBundle getCarrierConfigForSubId(int subId) {
- return configLoader.getConfigForSubId(subId);
+ return configLoader.getConfigForSubId(subId, getOpPackageName());
}
private void registerSettingsObserver() {