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

Commit d1f547f8 authored by Shuo Qian's avatar Shuo Qian Committed by Automerger Merge Worker
Browse files

Add package checking with Uid in EuiccController#getEid am: 1221ede9 am: 193b5584

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/12289031

Change-Id: Ibd24800460e6636233639d1d1f2ea292a190178f
parents 7844460d 193b5584
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.telephony.euicc.EuiccInfo;
import android.telephony.euicc.EuiccManager;
import android.telephony.euicc.EuiccManager.OtaStatus;
import android.text.TextUtils;
import android.util.EventLog;
import android.util.Log;
import android.util.Pair;

@@ -191,6 +192,12 @@ public class EuiccController extends IEuiccController.Stub {
    @Override
    public String getEid(int cardId, String callingPackage) {
        boolean callerCanReadPhoneStatePrivileged = callerCanReadPhoneStatePrivileged();
        try {
            mAppOpsManager.checkPackage(Binder.getCallingUid(), callingPackage);
        } catch (SecurityException e) {
            EventLog.writeEvent(0x534e4554, "159062405", -1, "Missing UID checking");
            throw e;
        }
        long token = Binder.clearCallingIdentity();
        try {
            if (!callerCanReadPhoneStatePrivileged