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

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

Merge "Allow instant app resolution for any user" into oc-dev

parents 1e924df6 bf297bcf
Loading
Loading
Loading
Loading
+18 −16
Original line number Diff line number Diff line
@@ -5721,9 +5721,6 @@ public class PackageManagerService extends IPackageManager.Stub {
            Intent intent, List<ResolveInfo> resolvedActivities, int userId,
            boolean skipPackageCheck) {
        final int callingUser = UserHandle.getCallingUserId();
        if (callingUser != UserHandle.USER_SYSTEM) {
            return false;
        }
        if (mInstantAppResolverConnection == null) {
            return false;
        }
@@ -6334,7 +6331,11 @@ public class PackageManagerService extends IPackageManager.Stub {
                    Slog.v(TAG, "Adding ephemeral installer to the ResolveInfo list");
                }
                final ResolveInfo ephemeralInstaller = new ResolveInfo(mInstantAppInstallerInfo);
                ephemeralInstaller.activityInfo = new ActivityInfo(mInstantAppInstallerActivity);
                final PackageSetting ps =
                        mSettings.mPackages.get(mInstantAppInstallerActivity.packageName);
                if (ps != null) {
                    ephemeralInstaller.activityInfo = PackageParser.generateActivityInfo(
                            mInstantAppInstallerActivity, 0, ps.readUserState(userId), userId);
                    ephemeralInstaller.activityInfo.launchToken = auxiliaryResponse.token;
                    ephemeralInstaller.auxiliaryInfo = auxiliaryResponse;
                    // make sure this resolver is the default
@@ -6348,6 +6349,7 @@ public class PackageManagerService extends IPackageManager.Stub {
                    ephemeralInstaller.instantAppAvailable = true;
                    result.add(ephemeralInstaller);
                }
            }
            Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
        }
        if (sortResult) {