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

Commit 2e0681f0 authored by Xin Li's avatar Xin Li
Browse files

DO NOT MERGE - Merge RQ3A.210805.001.A1.

Bug: 192585466
Merged-In: Ideef8793ac3c42ab30ac3004071d6be19e15b5fe
Change-Id: I4b1d873fb4c463c9a3f85679d1fdda523dba24f0
parents c81d6670 656bab2e
Loading
Loading
Loading
Loading
+18 −6
Original line number Original line Diff line number Diff line
@@ -59,6 +59,7 @@ import android.telephony.UiccAccessRule;
import android.telephony.UiccSlotInfo;
import android.telephony.UiccSlotInfo;
import android.telephony.euicc.EuiccManager;
import android.telephony.euicc.EuiccManager;
import android.text.TextUtils;
import android.text.TextUtils;
import android.util.EventLog;
import android.util.LocalLog;
import android.util.LocalLog;
import android.util.Log;
import android.util.Log;


@@ -914,6 +915,10 @@ public class SubscriptionController extends ISub.Stub {
            subList = getSubInfo(null, null);
            subList = getSubInfo(null, null);
            if (subList != null) {
            if (subList != null) {
                if (VDBG) logd("[getAllSubInfoList]- " + subList.size() + " infos return");
                if (VDBG) logd("[getAllSubInfoList]- " + subList.size() + " infos return");
                subList.stream().map(
                        subscriptionInfo -> conditionallyRemoveIdentifiers(subscriptionInfo,
                                callingPackage, callingFeatureId, "getAllSubInfoList"))
                        .collect(Collectors.toList());
            } else {
            } else {
                if (VDBG) logd("[getAllSubInfoList]- no info return");
                if (VDBG) logd("[getAllSubInfoList]- no info return");
            }
            }
@@ -1074,12 +1079,18 @@ public class SubscriptionController extends ISub.Stub {
    @Override
    @Override
    public List<SubscriptionInfo> getAvailableSubscriptionInfoList(String callingPackage,
    public List<SubscriptionInfo> getAvailableSubscriptionInfoList(String callingPackage,
            String callingFeatureId) {
            String callingFeatureId) {
        // This API isn't public, so no need to provide a valid subscription ID - we're not worried
        try {
        // about carrier-privileged callers not having access.
            enforceReadPrivilegedPhoneState("getAvailableSubscriptionInfoList");
        if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
        } catch (SecurityException e) {
                mContext, SubscriptionManager.INVALID_SUBSCRIPTION_ID, callingPackage,
            try {
                callingFeatureId, "getAvailableSubscriptionInfoList")) {
                mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_PHONE_STATE, null);
            throw new SecurityException("Need READ_PHONE_STATE to call "
                // 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");
                    + " getAvailableSubscriptionInfoList");
        }
        }


@@ -4205,6 +4216,7 @@ public class SubscriptionController extends ISub.Stub {
        if (!hasIdentifierAccess) {
        if (!hasIdentifierAccess) {
            result.clearIccId();
            result.clearIccId();
            result.clearCardString();
            result.clearCardString();
            result.clearGroupUuid();
        }
        }
        if (!hasPhoneNumberAccess) {
        if (!hasPhoneNumberAccess) {
            result.clearNumber();
            result.clearNumber();