Updated system packages retain shared user

If a system package was updated that used permissions provided by a
package signed with a different signature, it wouldn't grant
those permissions to the updated system app.

This is because the sharedUser field was not set in the disabled system
package. Therefore it was checking the disabled system package's
individual user permission grants which were empty.

This change populates the sharedUser field for disabled system packages
after reading all the existing shared users from the saved settings
database.

Bug: 4245273
Change-Id: I57c58c4083bd59f45095c184d6ca5a302f79ff6e
This commit is contained in:
Kenny Root
2011-04-08 14:25:24 -07:00
parent 9552766567
commit 1d1b489376

View File

@@ -1336,6 +1336,19 @@ final class Settings {
}
mPendingPackages.clear();
/*
* Make sure all the updated system packages have their shared users
* associated with them.
*/
final Iterator<PackageSetting> disabledIt = mDisabledSysPackages.values().iterator();
while (disabledIt.hasNext()) {
final PackageSetting disabledPs = disabledIt.next();
final Object id = getUserIdLPr(disabledPs.userId);
if (id != null && id instanceof SharedUserSetting) {
disabledPs.sharedUser = (SharedUserSetting) id;
}
}
readStoppedLPw();
mReadMessages.append("Read completed successfully: " + mPackages.size() + " packages, "