Carrier app with carrier privileges can't access SubscriptionPlan APIs
SubscriptionPlan APIs below are designed for carrier apps with carrier privileges: - SubscriptionManager.set/getSubscriptionPlan - SubscriptionManager.setSubscriptionOverrideUnmetered - SubscriptionManager.setSubscriptionOverrideCongested All those APIs were broken in a history fix (with SHA 172f15e5 introduced into RVC-QPR release) which try to call TelephonyManager.hasCarrierPrivileges inside NetworkPolicyManagerService to check if the carrier app has carrier privileges. hasCarrierPrivileges here actually check if NetworkPolicyManagerService has carrier privileges and always returns false. The fix is to check carrier privileges against the target calling package with utility method TelephonyManager.checkCarrierPrivilegesForPackage. Basic CTS test cases are introduced to verify the behavior. Bug: 377961753 Test: atest CarrierApiTest Flag: EXEMPT (minor bug fix) Change-Id: If78232dc9fc8f588c5b8b1c8fe7be44b09a4d207
Loading
Please register or sign in to comment