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
This commit is contained in:
Todd Kennedy
2015-10-21 13:09:10 -07:00
parent 8ba1cdd946
commit 68f6715bb2

View File

@@ -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());
}
}