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

Commit f8c55d81 authored by Patrick Huang's avatar Patrick Huang
Browse files

Fix Fi activation on Q

Clear calling identity before calling canManageActiveSubscriptionOnTargetSim()

Bug: 122768800
Test: Manual test on device
Change-Id: I61dcb5ca5647bdc38bfe7f0e00104888a52e949c
Merged-In: I61dcb5ca5647bdc38bfe7f0e00104888a52e949c
parent b97b5ef0
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -169,14 +169,17 @@ public class EuiccController extends IEuiccController.Stub {
     */
    @Override
    public String getEid(int cardId, String callingPackage) {
        if (!callerCanReadPhoneStatePrivileged()
        boolean callerCanReadPhoneStatePrivileged = callerCanReadPhoneStatePrivileged();
        long token = Binder.clearCallingIdentity();
        try {
            if (!callerCanReadPhoneStatePrivileged
                    && !canManageActiveSubscriptionOnTargetSim(cardId, callingPackage)) {
                throw new SecurityException(
                    "Must have carrier privileges on active subscription to read EID for cardId="
                        "Must have carrier privileges on active subscription to read EID for "
                                + "cardId="
                                + cardId);
            }
        long token = Binder.clearCallingIdentity();
        try {

            return blockingGetEidFromEuiccService(cardId);
        } finally {
            Binder.restoreCallingIdentity(token);