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

Commit ce601122 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Block instant apps before domain verification filtering" into sc-dev

parents e32074d8 f4afcc8a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2604,10 +2604,22 @@ public class PackageManagerService extends IPackageManager.Stub
            final ArrayList<ResolveInfo> matchAllList = new ArrayList<>();
            final ArrayList<ResolveInfo> undefinedList = new ArrayList<>();
            // Blocking instant apps is usually done in applyPostResolutionFilter, but since
            // domain verification can resolve to a single result, which can be an instant app,
            // it will then be filtered to an empty list in that method. Instead, do blocking
            // here so that instant apps can be ignored for approval filtering and a lower
            // priority result chosen instead.
            final boolean blockInstant = intent.isWebIntent() && areWebInstantAppsDisabled(userId);
            final int count = candidates.size();
            // First, try to use approved apps.
            for (int n = 0; n < count; n++) {
                ResolveInfo info = candidates.get(n);
                if (blockInstant && (info.isInstantAppAvailable
                        || isInstantApp(info.activityInfo.packageName, userId))) {
                    continue;
                }
                // Add to the special match all list (Browser use case)
                if (info.handleAllWebDataURI) {
                    matchAllList.add(info);