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

Commit d1e14959 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "filter deviceIdentifiers for subscriptionInfo if callers without perm"...

Merge "filter deviceIdentifiers for subscriptionInfo if callers without perm" into rvc-dev am: 27b607c4 am: 15ba3bdf am: c33b044b

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

Change-Id: I21b1cf7b3a42b986addac98e45b48d24b6839131
parents 7003aae1 c33b044b
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -900,6 +900,19 @@ public class SubscriptionController extends ISub.Stub {
    @Override
    public List<SubscriptionInfo> getAllSubInfoList(String callingPackage,
            String callingFeatureId) {
        return getAllSubInfoList(callingPackage, callingFeatureId, false);
    }

    /**
     * @param callingPackage The package making the IPC.
     * @param callingFeatureId The feature in the package
     * @param skipConditionallyRemoveIdentifier if set, skip removing identifier conditionally
     * @return List of all SubscriptionInfo records in database,
     * include those that were inserted before, maybe empty but not null.
     * @hide
     */
    public List<SubscriptionInfo> getAllSubInfoList(String callingPackage,
            String callingFeatureId, boolean skipConditionallyRemoveIdentifier) {
        if (VDBG) logd("[getAllSubInfoList]+");

        // This API isn't public, so no need to provide a valid subscription ID - we're not worried
@@ -918,9 +931,9 @@ public class SubscriptionController extends ISub.Stub {
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
        if (subList != null) {
        if (subList != null && !skipConditionallyRemoveIdentifier) {
            if (VDBG) logd("[getAllSubInfoList]- " + subList.size() + " infos return");
            subList.stream().map(
            subList = subList.stream().map(
                    subscriptionInfo -> conditionallyRemoveIdentifiers(subscriptionInfo,
                            callingPackage, callingFeatureId, "getAllSubInfoList"))
                    .collect(Collectors.toList());
@@ -3885,8 +3898,10 @@ public class SubscriptionController extends ISub.Stub {
        List<SubscriptionInfo> subInfoList;

        try {
            // need to bypass removing identifier check because that will remove the subList without
            // group id.
            subInfoList = getAllSubInfoList(mContext.getOpPackageName(),
                    mContext.getAttributionTag());
                    mContext.getAttributionTag(), true);
            if (groupUuid == null || subInfoList == null || subInfoList.isEmpty()) {
                return new ArrayList<>();
            }