Ignore sharedUserId when package already left shared UID
After a package has left shared UID, its non-shared UID state should be preserved after the next scan (e.g. reboot or an APK upgrade), or else the app would observe data loss. Bug: 235460457 Test: atest CtsSharedUserMigrationTestCases Change-Id: I692fe3ff59b43f2fc0ee53de0ce8a2f38cd29f02
This commit is contained in:
@@ -3701,8 +3701,9 @@ final class InstallPackageHelper {
|
|||||||
parsedPackage.getPackageName());
|
parsedPackage.getPackageName());
|
||||||
|
|
||||||
boolean ignoreSharedUserId = false;
|
boolean ignoreSharedUserId = false;
|
||||||
if (installedPkgSetting == null) {
|
if (installedPkgSetting == null || !installedPkgSetting.hasSharedUser()) {
|
||||||
// We can directly ignore sharedUserSetting for new installs
|
// Directly ignore sharedUserSetting for new installs, or if the app has
|
||||||
|
// already left shared UID
|
||||||
ignoreSharedUserId = parsedPackage.isLeavingSharedUid();
|
ignoreSharedUserId = parsedPackage.isLeavingSharedUid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user