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

Commit 84ba40de authored by John Wu's avatar John Wu
Browse files

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
parent 1664eecb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3701,8 +3701,9 @@ final class InstallPackageHelper {
                    parsedPackage.getPackageName());

            boolean ignoreSharedUserId = false;
            if (installedPkgSetting == null) {
                // We can directly ignore sharedUserSetting for new installs
            if (installedPkgSetting == null || !installedPkgSetting.hasSharedUser()) {
                // Directly ignore sharedUserSetting for new installs, or if the app has
                // already left shared UID
                ignoreSharedUserId = parsedPackage.isLeavingSharedUid();
            }