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

Commit ba63ae53 authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Fix default filtration.

Bug: 269127435
Test: adb shell device_config put package_manager_service com.android.server.pm.quarantined_enabled true && atest PackageManagerTest
Test: adb shell device_config put package_manager_service com.android.server.pm.quarantined_enabled false && atest PackageManagerTest
Change-Id: I436e9e2db1ff1214ed87a543e082a7b9226cd4be
parent 528aed69
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -516,6 +516,13 @@ final class ResolveIntentHelper {
            @PackageManager.ResolveInfoFlagsBits long flags, int userId) {
        if (!mUserManager.exists(userId)) return Collections.emptyList();
        final int callingUid = Binder.getCallingUid();

        // Only if the service query is coming from the system process,
        // it should be allowed to match quarantined components
        if (callingUid != Process.SYSTEM_UID) {
            flags |= PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
        }

        final String instantAppPkgName = computer.getInstantAppPackageName(callingUid);
        flags = computer.updateFlagsForResolve(flags, userId, callingUid, false /*includeInstantApps*/,
                false /* isImplicitImageCaptureIntentAndNotSetByDpc */);