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

Commit a927760c authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

canRequestPackageInstalls returns false for instant apps

Instant apps should not be able to request app installs, regardless of
the app op state.

Test: cts-instant-tradefed run cts-instant-dev -m \
CtsExternalSourcesTestCases
cts-tradefed run cts-dev -m CtsExternalSourcesTestCases

Bug: 79485871
Change-Id: I6bee50b57e6820f5786dfbc82d042acce93fc1b4
parent ab38e73a
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -24384,6 +24384,9 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
        if (info.targetSdkVersion < Build.VERSION_CODES.O) {
        if (info.targetSdkVersion < Build.VERSION_CODES.O) {
            return false;
            return false;
        }
        }
        if (isInstantApp(packageName, userId)) {
            return false;
        }
        String appOpPermission = Manifest.permission.REQUEST_INSTALL_PACKAGES;
        String appOpPermission = Manifest.permission.REQUEST_INSTALL_PACKAGES;
        String[] packagesDeclaringPermission = getAppOpPermissionPackages(appOpPermission);
        String[] packagesDeclaringPermission = getAppOpPermissionPackages(appOpPermission);
        if (!ArrayUtils.contains(packagesDeclaringPermission, packageName)) {
        if (!ArrayUtils.contains(packagesDeclaringPermission, packageName)) {