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

Commit 886c140b authored by Todd Kennedy's avatar Todd Kennedy Committed by android-build-merger
Browse files

Merge "Block the upgrade of persistent apps" am: 0b30d95d am: 6de91158

am: 3175c621

Change-Id: I5319cc775e7381e697ae365cdf7433d4bfdf56bd
parents b0fbfcea 3175c621
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -16420,6 +16420,13 @@ public class PackageManagerService extends IPackageManager.Stub
                                        + " target SDK " + oldTargetSdk + " does.");
                        return;
                    }
                    // Prevent persistent apps from being updated
                    if ((oldPackage.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) != 0) {
                        res.setError(PackageManager.INSTALL_FAILED_INVALID_APK,
                                "Package " + oldPackage.packageName + " is a persistent app. "
                                        + "Persistent apps are not updateable.");
                        return;
                    }
                    // Prevent apps from downgrading their targetSandbox.
                    final int oldTargetSandbox = oldPackage.applicationInfo.targetSandboxVersion;
                    final int newTargetSandbox = pkg.applicationInfo.targetSandboxVersion;