Merge "Correctly propagate permissions when uninstalling updates." into mnc-dev

This commit is contained in:
Jeff Davidson
2015-08-07 01:39:14 +00:00
committed by Android (Google) Code Review

View File

@ -12942,6 +12942,10 @@ public class PackageManagerService extends IPackageManager.Stub {
synchronized (mPackages) {
PackageSetting ps = mSettings.mPackages.get(newPkg.packageName);
// Propagate the permissions state as we do not want to drop on the floor
// runtime permissions. The update permissions method below will take
// care of removing obsolete permissions and grant install permissions.
ps.getPermissionsState().copyFrom(newPs.getPermissionsState());
updatePermissionsLPw(newPkg.packageName, newPkg,
UPDATE_PERMISSIONS_ALL | UPDATE_PERMISSIONS_REPLACE_PKG);