Merge "When the sharedUserSetting of the application on /system is different from the sharedUserSetting on /data, we should trust the sharedUserSetting on /system" am: b51e99de88

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2481897

Change-Id: I26e02c7054edde0b40292f52e643c101b464dd28
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Song Chun Fan
2023-03-22 22:39:07 +00:00
committed by Automerger Merge Worker

View File

@@ -3938,10 +3938,14 @@ final class InstallPackageHelper {
deletePackageHelper.deletePackageLIF(parsedPackage.getPackageName(), null, true, deletePackageHelper.deletePackageLIF(parsedPackage.getPackageName(), null, true,
mPm.mUserManager.getUserIds(), 0, null, false); mPm.mUserManager.getUserIds(), 0, null, false);
} }
} else if (newPkgVersionGreater) { } else if (newPkgVersionGreater || newSharedUserSetting) {
// The application on /system is newer than the application on /data. // The application on /system is newer than the application on /data.
// Simply remove the application on /data [keeping application data] // Simply remove the application on /data [keeping application data]
// and replace it with the version on /system. // and replace it with the version on /system.
// Also, if the sharedUserSetting of the application on /system is different
// from the sharedUserSetting on data, we should trust the sharedUserSetting
// on /system, even if the application version on /system is smaller than
// the version on /data.
logCriticalInfo(Log.WARN, logCriticalInfo(Log.WARN,
"System package enabled;" "System package enabled;"
+ " name: " + pkgSetting.getPackageName() + " name: " + pkgSetting.getPackageName()