RESTRICT AUTOMERGE am: bf04ea6d3b

Change-Id: I4c99e09d21cd93af567f186ae1e86ab076c96ce3
This commit is contained in:
Automerger Merge Worker
2019-12-13 00:26:31 +00:00

View File

@@ -18605,7 +18605,7 @@ public class PackageManagerService extends IPackageManager.Stub
continue; continue;
} }
List<VersionedPackage> libClientPackages = getPackagesUsingSharedLibraryLPr( List<VersionedPackage> libClientPackages = getPackagesUsingSharedLibraryLPr(
libraryInfo, 0, currUserId); libraryInfo, MATCH_KNOWN_PACKAGES, currUserId);
if (!ArrayUtils.isEmpty(libClientPackages)) { if (!ArrayUtils.isEmpty(libClientPackages)) {
Slog.w(TAG, "Not removing package " + pkg.manifestPackageName Slog.w(TAG, "Not removing package " + pkg.manifestPackageName
+ " hosting lib " + libraryInfo.getName() + " version " + " hosting lib " + libraryInfo.getName() + " version "
@@ -19018,10 +19018,11 @@ public class PackageManagerService extends IPackageManager.Stub
* Tries to delete system package. * Tries to delete system package.
*/ */
private void deleteSystemPackageLIF(DeletePackageAction action, PackageSetting deletedPs, private void deleteSystemPackageLIF(DeletePackageAction action, PackageSetting deletedPs,
int[] allUserHandles, int flags, PackageRemovedInfo outInfo, boolean writeSettings) int[] allUserHandles, int flags, @Nullable PackageRemovedInfo outInfo,
boolean writeSettings)
throws SystemDeleteException { throws SystemDeleteException {
final boolean applyUserRestrictions final boolean applyUserRestrictions =
= (allUserHandles != null) && (outInfo.origUsers != null); (allUserHandles != null) && outInfo != null && (outInfo.origUsers != null);
final PackageParser.Package deletedPkg = deletedPs.pkg; final PackageParser.Package deletedPkg = deletedPs.pkg;
// Confirm if the system package has been updated // Confirm if the system package has been updated
// An updated system app can be deleted. This will also have to restore // An updated system app can be deleted. This will also have to restore
@@ -19042,19 +19043,21 @@ public class PackageManagerService extends IPackageManager.Stub
} }
} }
// Delete the updated package if (outInfo != null) {
outInfo.isRemovedPackageSystemUpdate = true; // Delete the updated package
if (outInfo.removedChildPackages != null) { outInfo.isRemovedPackageSystemUpdate = true;
final int childCount = (deletedPs.childPackageNames != null) if (outInfo.removedChildPackages != null) {
? deletedPs.childPackageNames.size() : 0; final int childCount = (deletedPs.childPackageNames != null)
for (int i = 0; i < childCount; i++) { ? deletedPs.childPackageNames.size() : 0;
String childPackageName = deletedPs.childPackageNames.get(i); for (int i = 0; i < childCount; i++) {
if (disabledPs.childPackageNames != null && disabledPs.childPackageNames String childPackageName = deletedPs.childPackageNames.get(i);
.contains(childPackageName)) { if (disabledPs.childPackageNames != null && disabledPs.childPackageNames
PackageRemovedInfo childInfo = outInfo.removedChildPackages.get( .contains(childPackageName)) {
childPackageName); PackageRemovedInfo childInfo = outInfo.removedChildPackages.get(
if (childInfo != null) { childPackageName);
childInfo.isRemovedPackageSystemUpdate = true; if (childInfo != null) {
childInfo.isRemovedPackageSystemUpdate = true;
}
} }
} }
} }
@@ -19087,7 +19090,8 @@ public class PackageManagerService extends IPackageManager.Stub
if (DEBUG_REMOVE) Slog.d(TAG, "Re-installing system package: " + disabledPs); if (DEBUG_REMOVE) Slog.d(TAG, "Re-installing system package: " + disabledPs);
try { try {
installPackageFromSystemLIF(disabledPs.codePathString, allUserHandles, installPackageFromSystemLIF(disabledPs.codePathString, allUserHandles,
outInfo.origUsers, deletedPs.getPermissionsState(), writeSettings); outInfo == null ? null : outInfo.origUsers, deletedPs.getPermissionsState(),
writeSettings);
} catch (PackageManagerException e) { } catch (PackageManagerException e) {
Slog.w(TAG, "Failed to restore system package:" + deletedPkg.packageName + ": " Slog.w(TAG, "Failed to restore system package:" + deletedPkg.packageName + ": "
+ e.getMessage()); + e.getMessage());
@@ -22939,9 +22943,9 @@ public class PackageManagerService extends IPackageManager.Stub
mSettings.writeKernelMappingLPr(ps); mSettings.writeKernelMappingLPr(ps);
} }
final UserManager um = mContext.getSystemService(UserManager.class); final UserManagerService um = sUserManager;
UserManagerInternal umInternal = getUserManagerInternal(); UserManagerInternal umInternal = getUserManagerInternal();
for (UserInfo user : um.getUsers()) { for (UserInfo user : um.getUsers(false /* excludeDying */)) {
final int flags; final int flags;
if (umInternal.isUserUnlockingOrUnlocked(user.id)) { if (umInternal.isUserUnlockingOrUnlocked(user.id)) {
flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE; flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE;
@@ -23624,8 +23628,9 @@ public class PackageManagerService extends IPackageManager.Stub
continue; continue;
} }
final String packageName = ps.pkg.packageName; final String packageName = ps.pkg.packageName;
// Skip over if system app // Skip over if system app or static shared library
if ((ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0) { if ((ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0
|| !TextUtils.isEmpty(ps.pkg.staticSharedLibName)) {
continue; continue;
} }
if (DEBUG_CLEAN_APKS) { if (DEBUG_CLEAN_APKS) {