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

Commit 33284ae0 authored by Sooraj Sasindran's avatar Sooraj Sasindran
Browse files

use phone permission to access active subscription info

use phone permission to access active subscription info

Bug: 188553890
Test: ran unit test
Change-Id: I095591934b5473d0b335e863e978da3db800f03e
parent 1de79d89
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -650,7 +650,13 @@ public final class TelephonyPermissions {
    private static boolean checkCarrierPrivilegeForAnySubId(Context context, int uid) {
        SubscriptionManager sm = (SubscriptionManager) context.getSystemService(
                Context.TELEPHONY_SUBSCRIPTION_SERVICE);
        int[] activeSubIds = sm.getCompleteActiveSubscriptionIdList();
        int[] activeSubIds;
        final long identity = Binder.clearCallingIdentity();
        try {
            activeSubIds = sm.getCompleteActiveSubscriptionIdList();
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
        for (int activeSubId : activeSubIds) {
            if (getCarrierPrivilegeStatus(context, activeSubId, uid)
                    == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {