Merge "Instant app uninstallation fix."

This commit is contained in:
Alex Buynytskyy
2022-02-09 05:39:36 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 3 deletions

View File

@@ -222,8 +222,12 @@ final class DeletePackageHelper {
deleteFlags | PackageManager.DELETE_CHATTY, info, true);
}
if (res && pkg != null) {
final boolean packageInstalledForSomeUsers;
synchronized (mPm.mLock) {
packageInstalledForSomeUsers = mPm.mPackages.get(pkg.getPackageName()) != null;
}
mPm.mInstantAppRegistry.onPackageUninstalled(pkg, uninstalledPs,
info.mRemovedUsers);
info.mRemovedUsers, packageInstalledForSomeUsers);
}
synchronized (mPm.mLock) {
if (res) {

View File

@@ -444,14 +444,14 @@ public class InstantAppRegistry implements Watchable, Snappable {
}
public void onPackageUninstalled(@NonNull AndroidPackage pkg, @NonNull PackageSetting ps,
@NonNull int[] userIds) {
@NonNull int[] userIds, boolean packageInstalledForSomeUsers) {
if (ps == null) {
return;
}
synchronized (mLock) {
for (int userId : userIds) {
if (ps.getInstalled(userId)) {
if (packageInstalledForSomeUsers && ps.getInstalled(userId)) {
continue;
}