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

Commit 1e5e12c7 authored by android-build-team Robot's avatar android-build-team Robot Committed by Anis Assi
Browse files

Merge cherrypicks of [14947151, 14946920, 14946921, 14946922, 14947510,...

Merge cherrypicks of [14947151, 14946920, 14946921, 14946922, 14947510, 14947511, 14947512, 14947530, 14947531, 14946923, 14947513] into security-aosp-rvc-release

Change-Id: I66bd69cb2ff1077541dc728e504c204642e93f1e
parents 95c2a717 a5b1af74
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import android.telephony.UiccAccessRule;
import android.telephony.UiccSlotInfo;
import android.telephony.euicc.EuiccManager;
import android.text.TextUtils;
import android.util.EventLog;
import android.util.LocalLog;
import android.util.Log;

@@ -1045,12 +1046,18 @@ public class SubscriptionController extends ISub.Stub {
    @Override
    public List<SubscriptionInfo> getAvailableSubscriptionInfoList(String callingPackage,
            String callingFeatureId) {
        // This API isn't public, so no need to provide a valid subscription ID - we're not worried
        // about carrier-privileged callers not having access.
        if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
                mContext, SubscriptionManager.INVALID_SUBSCRIPTION_ID, callingPackage,
                callingFeatureId, "getAvailableSubscriptionInfoList")) {
            throw new SecurityException("Need READ_PHONE_STATE to call "
        try {
            enforceReadPrivilegedPhoneState("getAvailableSubscriptionInfoList");
        } catch (SecurityException e) {
            try {
                mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_PHONE_STATE, null);
                // If caller doesn't have READ_PRIVILEGED_PHONE_STATE permission but only
                // has READ_PHONE_STATE permission, log this event.
                EventLog.writeEvent(0x534e4554, "185235454", Binder.getCallingUid());
            } catch (SecurityException ex) {
                // Ignore
            }
            throw new SecurityException("Need READ_PRIVILEGED_PHONE_STATE to call "
                    + " getAvailableSubscriptionInfoList");
        }