summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Buynytskyy <alexbuy@google.com>2023-12-20 01:50:36 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-07 02:25:23 +0000
commit1eaf2c28e84f5adaa41efc615484a5d4d021e89b (patch)
tree679f544efe37a33878aaf4e7bbfd558b823bd655
parent2090acecf3d55d4a344e21912f8862c973de5a09 (diff)
downloadbase-1eaf2c28e84f5adaa41efc615484a5d4d021e89b.tar.gz
Disallow system apps to be installed/updated as instant.
Bug: 299441833 Test: atest android.content.pm.cts.PackageManagerTest (cherry picked from commit 496e78a1951f2ed69290f03c5625c0f8382f4d31) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c61ee9f45233a35da687942d5af24a5d09568a6c) Merged-In: Idd89a6dd72f0e68259095f677185f0494391025c Change-Id: Idd89a6dd72f0e68259095f677185f0494391025c
-rw-r--r--services/core/java/com/android/server/pm/InstallPackageHelper.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java
index 259701166147..a56ac9de6ebe 100644
--- a/services/core/java/com/android/server/pm/InstallPackageHelper.java
+++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java
@@ -559,6 +559,9 @@ final class InstallPackageHelper {
if (pkgSetting == null) {
return PackageManager.INSTALL_FAILED_INVALID_URI;
}
+ if (instantApp && (pkgSetting.isSystem() || pkgSetting.isUpdatedSystemApp())) {
+ return PackageManager.INSTALL_FAILED_INVALID_URI;
+ }
if (!snapshot.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