if (packages.remove(packageSetting)) {
// recalculate the pkgFlags for this shared user if needed
if ((this.pkgFlags & packageSetting.pkgFlags) != 0) {
int aggregatedFlags = uidFlags;
for (PackageSetting ps : packages) {
aggregatedFlags |= ps.pkgFlags;
}
setFlags(aggregatedFlags);
}
}