diff options
author | Todd Kennedy <toddke@google.com> | 2015-10-21 20:33:31 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-21 20:33:31 +0000 |
commit | 0cd10ec8cf7a896bbdfc0639bf5f9c663c46edbb (patch) | |
tree | 3616ff50f4d75461dcf619f824bd2cad88bb77fe /services | |
parent | 052366ca4e6138b583d08535bd1837deb7cd58d0 (diff) | |
parent | 68f6715bb283de2aa1678ffa16f69fd897300d8d (diff) | |
download | frameworks_base-0cd10ec8cf7a896bbdfc0639bf5f9c663c46edbb.zip frameworks_base-0cd10ec8cf7a896bbdfc0639bf5f9c663c46edbb.tar.gz frameworks_base-0cd10ec8cf7a896bbdfc0639bf5f9c663c46edbb.tar.bz2 |
Merge "Maintain shared user list on OTA" into mnc-dr-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/pm/Settings.java | 13 |
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()); } } |