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

Commit 2981683f authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Android (Google) Code Review
Browse files

Merge "Instant app uninstallation fix."

parents 5c865542 3e084b0c
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -222,8 +222,12 @@ final class DeletePackageHelper {
                        deleteFlags | PackageManager.DELETE_CHATTY, info, true);
                        deleteFlags | PackageManager.DELETE_CHATTY, info, true);
            }
            }
            if (res && pkg != null) {
            if (res && pkg != null) {
                final boolean packageInstalledForSomeUsers;
                synchronized (mPm.mLock) {
                    packageInstalledForSomeUsers = mPm.mPackages.get(pkg.getPackageName()) != null;
                }
                mPm.mInstantAppRegistry.onPackageUninstalled(pkg, uninstalledPs,
                mPm.mInstantAppRegistry.onPackageUninstalled(pkg, uninstalledPs,
                        info.mRemovedUsers);
                        info.mRemovedUsers, packageInstalledForSomeUsers);
            }
            }
            synchronized (mPm.mLock) {
            synchronized (mPm.mLock) {
                if (res) {
                if (res) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -444,14 +444,14 @@ public class InstantAppRegistry implements Watchable, Snappable {
    }
    }


    public void onPackageUninstalled(@NonNull AndroidPackage pkg, @NonNull PackageSetting ps,
    public void onPackageUninstalled(@NonNull AndroidPackage pkg, @NonNull PackageSetting ps,
            @NonNull int[] userIds) {
            @NonNull int[] userIds, boolean packageInstalledForSomeUsers) {
        if (ps == null) {
        if (ps == null) {
            return;
            return;
        }
        }


        synchronized (mLock) {
        synchronized (mLock) {
            for (int userId : userIds) {
            for (int userId : userIds) {
                if (ps.getInstalled(userId)) {
                if (packageInstalledForSomeUsers && ps.getInstalled(userId)) {
                    continue;
                    continue;
                }
                }