am 0f8ec44b: Merge "Prune shared users that the system declares but does not use" into klp-dev
* commit '0f8ec44b13487f5726cab77eb79cac016e090b25': Prune shared users that the system declares but does not use
This commit is contained in:
@@ -1349,6 +1349,9 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
//delete tmp files
|
||||
deleteTempPackageFiles();
|
||||
|
||||
// Remove any shared userIDs that have no associated packages
|
||||
mSettings.pruneSharedUsersLPw();
|
||||
|
||||
if (!mOnlyCore) {
|
||||
EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_PMS_DATA_SCAN_START,
|
||||
SystemClock.uptimeMillis());
|
||||
|
||||
@@ -351,6 +351,19 @@ final class Settings {
|
||||
return null;
|
||||
}
|
||||
|
||||
void pruneSharedUsersLPw() {
|
||||
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) {
|
||||
removeStage.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < removeStage.size(); i++) {
|
||||
mSharedUsers.remove(removeStage.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
// Transfer ownership of permissions from one package to another.
|
||||
void transferPermissionsLPw(String origPkg, String newPkg) {
|
||||
// Transfer ownership of permissions to the new package.
|
||||
|
||||
Reference in New Issue
Block a user