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

Commit 3d5604dc authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Make sure we're locked

Before calling a method ending with LPw, we need to have the mPackages lock.
Make sure we do that.

Also, ditch the iterator for traversing an ArraySet.

Bug: 29356333
Change-Id: I67df971f2961b577f31153cef46fb153458d6965
parent 68dd6233
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -4753,10 +4753,8 @@ public class PackageManagerService extends IPackageManager.Stub {
                final SharedUserSetting sus = (SharedUserSetting) obj;
                final int N = sus.packages.size();
                final String[] res = new String[N];
                final Iterator<PackageSetting> it = sus.packages.iterator();
                int i = 0;
                while (it.hasNext()) {
                    res[i++] = it.next().name;
                for (int i = 0; i < N; i++) {
                    res[i] = sus.packages.valueAt(i).name;
                }
                return res;
            } else if (obj instanceof PackageSetting) {
@@ -14478,7 +14476,9 @@ public class PackageManagerService extends IPackageManager.Stub {
        // Remove existing system package
        removePackageLI(deletedPackage, true);
        synchronized (mPackages) {
            disabledSystem = disableSystemPackageLPw(deletedPackage, pkg);
        }
        if (!disabledSystem) {
            // We didn't need to disable the .apk as a current system package,
            // which means we are replacing another update that is already