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

Commit fadec035 authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Filter activity starts that target package name

This change filters activity starts / queries done by package name the
same as is currently done by ComponentName for consistency.

Fixes: 148657387
Test: atest InstantAppTest EphemeralTest AppEnumerationTests
Change-Id: I4ad2be5b83a0b60fbc3dcf423846742c4deb5086
parent c12ddbbc
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -7210,11 +7210,14 @@ public class PackageManagerService extends IPackageManager.Stub
                    sortResult = true;
                }
            } else {
                final AndroidPackage pkg = mPackages.get(pkgName);
                final PackageSetting setting =
                        getPackageSettingInternal(pkgName, Process.SYSTEM_UID);
                result = null;
                if (pkg != null) {
                if (setting != null && setting.pkg != null
                        && !shouldFilterApplicationLocked(setting, filterCallingUid, userId)) {
                    result = filterIfNotSystemUser(mComponentResolver.queryActivities(
                            intent, resolvedType, flags, pkg.getActivities(), userId), userId);
                            intent, resolvedType, flags, setting.pkg.getActivities(), userId),
                            userId);
                }
                if (result == null || result.size() == 0) {
                    // the caller wants to resolve for a particular package; however, there