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
(cherry picked from commit 84ba40de12dac4efa6b90197e910dcdf432009f5)
Merged-In: I692fe3ff59b43f2fc0ee53de0ce8a2f38cd29f02
1 file changed