summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorTodd Kennedy <toddke@google.com>2015-10-21 13:09:10 -0700
committerTodd Kennedy <toddke@google.com>2015-10-21 13:22:01 -0700
commit68f6715bb283de2aa1678ffa16f69fd897300d8d (patch)
tree97da084cef731b9e540d31c26a0a0f21e47ce86d /services
parent8ba1cdd9464b88375755e1976e4ee0f5620ff5be (diff)
downloadframeworks_base-68f6715bb283de2aa1678ffa16f69fd897300d8d.zip
frameworks_base-68f6715bb283de2aa1678ffa16f69fd897300d8d.tar.gz
frameworks_base-68f6715bb283de2aa1678ffa16f69fd897300d8d.tar.bz2
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
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/pm/Settings.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index 943e649..647c17b 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -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());
}
}