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

Commit 28597255 authored by John Wu's avatar John Wu Committed by Automerger Merge Worker
Browse files

Merge "Proper PendingIntent.queryIntentComponents implementation" into...

Merge "Proper PendingIntent.queryIntentComponents implementation" into tm-qpr-dev am: 22527dbf am: 10f223b8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19505947



Change-Id: I4c3f05675e138af365f8c1c0cb5301e49b31bea0
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9f795604 10f223b8
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -454,6 +454,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -5501,7 +5502,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            IIntentSender pendingResult, int matchFlags) {
        enforceCallingPermission(Manifest.permission.GET_INTENT_SENDER_INTENT,
                "queryIntentComponentsForIntentSender()");
        Preconditions.checkNotNull(pendingResult);
        Objects.requireNonNull(pendingResult);
        final PendingIntentRecord res;
        try {
            res = (PendingIntentRecord) pendingResult;
@@ -5513,17 +5514,19 @@ public class ActivityManagerService extends IActivityManager.Stub
            return null;
        }
        final int userId = res.key.userId;
        final int uid = res.uid;
        final String resolvedType = res.key.requestResolvedType;
        switch (res.key.type) {
            case ActivityManager.INTENT_SENDER_ACTIVITY:
                return new ParceledListSlice<>(mContext.getPackageManager()
                        .queryIntentActivitiesAsUser(intent, matchFlags, userId));
                return new ParceledListSlice<>(mPackageManagerInt.queryIntentActivities(
                        intent, resolvedType, matchFlags, uid, userId));
            case ActivityManager.INTENT_SENDER_SERVICE:
            case ActivityManager.INTENT_SENDER_FOREGROUND_SERVICE:
                return new ParceledListSlice<>(mContext.getPackageManager()
                        .queryIntentServicesAsUser(intent, matchFlags, userId));
                return new ParceledListSlice<>(mPackageManagerInt.queryIntentServices(
                        intent, matchFlags, uid, userId));
            case ActivityManager.INTENT_SENDER_BROADCAST:
                return new ParceledListSlice<>(mContext.getPackageManager()
                        .queryBroadcastReceiversAsUser(intent, matchFlags, userId));
                return new ParceledListSlice<>(mPackageManagerInt.queryIntentReceivers(
                        intent, resolvedType, matchFlags, uid, userId, false));
            default: // ActivityManager.INTENT_SENDER_ACTIVITY_RESULT
                throw new IllegalStateException("Unsupported intent sender type: " + res.key.type);
        }
+2 −0
Original line number Diff line number Diff line
@@ -112,6 +112,8 @@ public interface Computer extends PackageDataSnapshot {
            @PackageManager.ResolveInfoFlagsBits long flags,
            @PackageManagerInternal.PrivateResolveFlags long privateResolveFlags,
            int filterCallingUid, int userId, boolean resolveForStart, boolean allowDynamicSplits);
    @NonNull List<ResolveInfo> queryIntentActivitiesInternal(Intent intent, String resolvedType,
            long flags, int filterCallingUid, int userId);
    @NonNull List<ResolveInfo> queryIntentActivitiesInternal(Intent intent, String resolvedType,
            long flags, int userId);
    @NonNull List<ResolveInfo> queryIntentServicesInternal(Intent intent, String resolvedType,
+9 −0
Original line number Diff line number Diff line
@@ -608,6 +608,15 @@ public class ComputerEngine implements Computer {
                resolveForStart, userId, intent);
    }

    @NonNull
    @Override
    public final List<ResolveInfo> queryIntentActivitiesInternal(Intent intent, String resolvedType,
            @PackageManager.ResolveInfoFlagsBits long flags, int filterCallingUid, int userId) {
        return queryIntentActivitiesInternal(
                intent, resolvedType, flags, 0 /*privateResolveFlags*/, filterCallingUid,
                userId, false /*resolveForStart*/, true /*allowDynamicSplits*/);
    }

    public final @NonNull List<ResolveInfo> queryIntentActivitiesInternal(Intent intent,
            String resolvedType, @PackageManager.ResolveInfoFlagsBits long flags, int userId) {
        return queryIntentActivitiesInternal(
+2 −1
Original line number Diff line number Diff line
@@ -309,7 +309,8 @@ abstract class PackageManagerInternalBase extends PackageManagerInternal {
    public final List<ResolveInfo> queryIntentActivities(
            Intent intent, String resolvedType, @PackageManager.ResolveInfoFlagsBits long flags,
            int filterCallingUid, int userId) {
        return snapshot().queryIntentActivitiesInternal(intent, resolvedType, flags, userId);
        return snapshot().queryIntentActivitiesInternal(intent, resolvedType, flags,
                filterCallingUid, userId);
    }

    @Override