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

Commit 7eacf14e authored by Nazanin Bakhshi's avatar Nazanin Bakhshi Committed by Android (Google) Code Review
Browse files

Merge "Security fix: as part of enforcing read privilege permission to check...

Merge "Security fix: as part of enforcing read privilege permission to check package privileges in TelephonyManager, clear calling identity to ensure current functionalities work" into sc-dev
parents 8c891c10 1deeb0cd
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -1538,8 +1538,13 @@ public class EuiccController extends IEuiccController.Stub {


            // There is no active subscription on the target SIM, checks whether the caller can
            // There is no active subscription on the target SIM, checks whether the caller can
            // manage any active subscription on any other SIM.
            // manage any active subscription on any other SIM.
            final long token = Binder.clearCallingIdentity();
            try {
                return mTelephonyManager.checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
                return mTelephonyManager.checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
                    == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
                    == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        } else {
        } else {
            for (SubscriptionInfo subInfo : subInfoList) {
            for (SubscriptionInfo subInfo : subInfoList) {
                if (subInfo.isEmbedded()
                if (subInfo.isEmbedded()