am 790518a1: Merge "Implicitly enable system apps when updates installed" into jb-mr2-dev
* commit '790518a1a2f06030d19fdd896bd0f80dd03d94fc': Implicitly enable system apps when updates installed
This commit is contained in:
@@ -8249,6 +8249,24 @@ public class PackageManagerService extends IPackageManager.Stub {
|
|||||||
updatePermissionsLPw(newPackage.packageName, newPackage,
|
updatePermissionsLPw(newPackage.packageName, newPackage,
|
||||||
UPDATE_PERMISSIONS_REPLACE_PKG | (newPackage.permissions.size() > 0
|
UPDATE_PERMISSIONS_REPLACE_PKG | (newPackage.permissions.size() > 0
|
||||||
? UPDATE_PERMISSIONS_ALL : 0));
|
? UPDATE_PERMISSIONS_ALL : 0));
|
||||||
|
// For system-bundled packages, we assume that installing an upgraded version
|
||||||
|
// of the package implies that the user actually wants to run that new code,
|
||||||
|
// so we enable the package.
|
||||||
|
if (isSystemApp(newPackage)) {
|
||||||
|
// NB: implicit assumption that system package upgrades apply to all users
|
||||||
|
if (DEBUG_INSTALL) {
|
||||||
|
Slog.d(TAG, "Implicitly enabling system package on upgrade: " + pkgName);
|
||||||
|
}
|
||||||
|
PackageSetting ps = mSettings.mPackages.get(pkgName);
|
||||||
|
if (ps != null) {
|
||||||
|
if (res.origUsers != null) {
|
||||||
|
for (int userHandle : res.origUsers) {
|
||||||
|
ps.setEnabled(COMPONENT_ENABLED_STATE_DEFAULT,
|
||||||
|
userHandle, installerPackageName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
res.name = pkgName;
|
res.name = pkgName;
|
||||||
res.uid = newPackage.applicationInfo.uid;
|
res.uid = newPackage.applicationInfo.uid;
|
||||||
res.pkg = newPackage;
|
res.pkg = newPackage;
|
||||||
|
|||||||
Reference in New Issue
Block a user