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

Commit 83dcc260 authored by Tony Mak's avatar Tony Mak Committed by android-build-merger
Browse files

DO NOT MERGE: Cross profile candidate should be considered

am: ff11122d

Change-Id: I9de28d980021579d70d85193b1994ddca042d4fa
parents 2abde827 ff11122d
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -5407,16 +5407,24 @@ public class PackageManagerService extends IPackageManager.Stub {
                            result.remove(xpResolveInfo);
                        }
                        if (result.size() == 0 && !addEphemeral) {
                            // No result in current profile, but found candidate in parent user.
                            // And we are not going to add emphemeral app, so we can return the
                            // result straight away.
                            result.add(xpDomainInfo.resolveInfo);
                            return result;
                        }
                    } else if (result.size() <= 1 && !addEphemeral) {
                        // No result in parent user and <= 1 result in current profile, and we
                        // are not going to add emphemeral app, so we can return the result without
                        // further processing.
                        return result;
                    }
                    if (result.size() > 1 || addEphemeral) {
                    // We have more than one candidate (combining results from current and parent
                    // profile), so we need filtering and sorting.
                    result = filterCandidatesWithDomainPreferredActivitiesLPr(
                            intent, flags, result, xpDomainInfo, userId);
                    sortResult = true;
                }
                }
            } else {
                final PackageParser.Package pkg = mPackages.get(pkgName);
                if (pkg != null) {