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

Commit bf297bcf authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Allow instant app resolution for any user

Change-Id: Iaf26cfda3a8226d97eb147b0a9e62f051b33e81b
Fixes: 37215608
Test: Swtich to secondary user and see that instant apps resolve and launch
parent 13acf25c
Loading
Loading
Loading
Loading
+18 −16
Original line number Diff line number Diff line
@@ -5727,9 +5727,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;
        }
@@ -6340,7 +6337,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
@@ -6354,6 +6355,7 @@ public class PackageManagerService extends IPackageManager.Stub {
                    ephemeralInstaller.instantAppAvailable = true;
                    result.add(ephemeralInstaller);
                }
            }
            Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
        }
        if (sortResult) {