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

Commit 3e084b0c authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Instant app uninstallation fix.

Bug: 217020148
Fixes: 217020148
Test: atest InstantCookieHostTest
Change-Id: I3f6292a4cbe69506265b3e25f6b6fc484bb1e46e
parent a0846285
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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) {
+2 −2
Original line number Diff line number Diff line
@@ -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;
                }