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

Commit 1deeb0cd authored by Nazanin's avatar Nazanin Committed by Nazanin Bakhshi
Browse files

Security fix: as part of enforcing read privilege permission to check package

privileges in TelephonyManager, clear calling identity to ensure current
functionalities work

Bug: 180938364
Test: cts
Change-Id: I274de9bb6a08f4279e3706948725b90d0a4cbb01
parent a4905a43
Loading
Loading
Loading
Loading
+6 −1
Original line number 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
            // manage any active subscription on any other SIM.
            final long token = Binder.clearCallingIdentity();
            try {
                return mTelephonyManager.checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
                    == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        } else {
            for (SubscriptionInfo subInfo : subInfoList) {
                if (subInfo.isEmbedded()