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

Commit 68f6715b authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Maintain shared user list on OTA

When a package is removed during an OTA, we weren't removing it from the
shared user list. This means anyone asking for the packages for a shared
UID would continue to see the old package.

Bug: 24906701
Change-Id: Ifb6d64195e6b8af7454e19591611af66a40cbd10
parent 8ba1cdd9
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -517,7 +517,18 @@ final class Settings {
        ArrayList<String> removeStage = new ArrayList<String>();
        for (Map.Entry<String,SharedUserSetting> entry : mSharedUsers.entrySet()) {
            final SharedUserSetting sus = entry.getValue();
            if (sus == null || sus.packages.size() == 0) {
            if (sus == null) {
                removeStage.add(entry.getKey());
                continue;
            }
            // remove packages that are no longer installed
            for (Iterator<PackageSetting> iter = sus.packages.iterator(); iter.hasNext();) {
                PackageSetting ps = iter.next();
                if (mPackages.get(ps.name) == null) {
                    iter.remove();
                }
            }
            if (sus.packages.size() == 0) {
                removeStage.add(entry.getKey());
            }
        }