Do not clear a shared user's permissions on an app install.
When regranting permissions for an app during an install if that app is in a shared user we should not clear the permissions as the permissions for the shared user are additive and go away when apps requesting them are uninstalled. bug:20050689 Change-Id: I82aa70669fc25a45e7020a1545b093db5525f5cf
This commit is contained in:
@@ -7397,8 +7397,10 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
|
||||
if (replace) {
|
||||
ps.installPermissionsFixed = false;
|
||||
origPermissions = new PermissionsState(permissionsState);
|
||||
permissionsState.reset();
|
||||
if (!ps.isSharedUser()) {
|
||||
origPermissions = new PermissionsState(permissionsState);
|
||||
permissionsState.reset();
|
||||
}
|
||||
}
|
||||
|
||||
permissionsState.setGlobalGids(mGlobalGids);
|
||||
|
||||
@@ -74,4 +74,8 @@ final class PackageSetting extends PackageSettingBase {
|
||||
public boolean isSystem() {
|
||||
return (pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0;
|
||||
}
|
||||
|
||||
public boolean isSharedUser() {
|
||||
return sharedUser != null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user