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

Commit 31845b30 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:...

Add package checking with Uid in EuiccController#getEid am: 1221ede9 am: 193b5584 am: d1f547f8 am: b26db379 am: 878ebc09 am: 2f892c02

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

Change-Id: I283be015a4ad2cc571f01506af0d2001eac222ba
parents da1184f2 2f892c02
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