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

Commit 0d0f185c authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Disallow system apps to be installed/updated as instant.

Bug: 299441833
Test: atest android.content.pm.cts.PackageManagerTest
Change-Id: Idd89a6dd72f0e68259095f677185f0494391025c
Merged-In: Idd89a6dd72f0e68259095f677185f0494391025c
(cherry picked from commit 496e78a1)
parent f371f64b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -16181,6 +16181,9 @@ public class PackageManagerService extends IPackageManager.Stub
                if (pkgSetting == null) {
                    return PackageManager.INSTALL_FAILED_INVALID_URI;
                }
                if (instantApp && (pkgSetting.isSystem() || isUpdatedSystemApp(pkgSetting))) {
                    return PackageManager.INSTALL_FAILED_INVALID_URI;
                }
                if (!canViewInstantApps(callingUid, UserHandle.getUserId(callingUid))) {
                    // only allow the existing package to be used if it's installed as a full
                    // application for at least one user