Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c29e2b8 authored by rambowang's avatar rambowang Committed by Rambo Wang
Browse files

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
parent 28cef9b7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment