diff options
author | Christopher Tate <ctate@google.com> | 2014-04-03 01:39:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-04-03 01:39:36 +0000 |
commit | a7d9b93756c8b1e61a721fe14d941ee7ab975513 (patch) | |
tree | 3d21f8b3509343d234245055fc6858ba7c4071bf /services | |
parent | 1970f570714a4746bf592e26731ea0ee8933d363 (diff) | |
parent | c935d1f11144443a91b3c03d7da82314db6e049b (diff) | |
download | frameworks_base-a7d9b93756c8b1e61a721fe14d941ee7ab975513.zip frameworks_base-a7d9b93756c8b1e61a721fe14d941ee7ab975513.tar.gz frameworks_base-a7d9b93756c8b1e61a721fe14d941ee7ab975513.tar.bz2 |
Merge "Refuse update of a system app if it changes its shared uid"
Diffstat (limited to 'services')
-rwxr-xr-x | services/core/java/com/android/server/pm/PackageManagerService.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 288e8e0..dd22b2d 100755 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -9214,9 +9214,20 @@ public class PackageManagerService extends IPackageManager.Stub { final PackageSetting newPkgSetting = (PackageSetting)newPackage.mExtras; newPkgSetting.firstInstallTime = oldPkgSetting.firstInstallTime; newPkgSetting.lastUpdateTime = System.currentTimeMillis(); + + // is the update attempting to change shared user? that isn't going to work... + if (oldPkgSetting.sharedUser != newPkgSetting.sharedUser) { + Slog.w(TAG, "Forbidding shared user change from " + oldPkgSetting.sharedUser + + " to " + newPkgSetting.sharedUser); + res.returnCode = PackageManager.INSTALL_FAILED_SHARED_USER_INCOMPATIBLE; + updatedSettings = true; + } + } + + if (res.returnCode == PackageManager.INSTALL_SUCCEEDED) { + updateSettingsLI(newPackage, installerPackageName, allUsers, perUserInstalled, res); + updatedSettings = true; } - updateSettingsLI(newPackage, installerPackageName, allUsers, perUserInstalled, res); - updatedSettings = true; } if (res.returnCode != PackageManager.INSTALL_SUCCEEDED) { |