Loading services/core/java/com/android/server/pm/PackageManagerService.java +27 −22 Original line number Diff line number Diff line Loading @@ -18605,7 +18605,7 @@ public class PackageManagerService extends IPackageManager.Stub continue; } List<VersionedPackage> libClientPackages = getPackagesUsingSharedLibraryLPr( libraryInfo, 0, currUserId); libraryInfo, MATCH_KNOWN_PACKAGES, currUserId); if (!ArrayUtils.isEmpty(libClientPackages)) { Slog.w(TAG, "Not removing package " + pkg.manifestPackageName + " hosting lib " + libraryInfo.getName() + " version " Loading Loading @@ -19018,10 +19018,11 @@ public class PackageManagerService extends IPackageManager.Stub * Tries to delete system package. */ 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 { final boolean applyUserRestrictions = (allUserHandles != null) && (outInfo.origUsers != null); final boolean applyUserRestrictions = (allUserHandles != null) && outInfo != null && (outInfo.origUsers != null); final PackageParser.Package deletedPkg = deletedPs.pkg; // Confirm if the system package has been updated // An updated system app can be deleted. This will also have to restore Loading @@ -19042,6 +19043,7 @@ public class PackageManagerService extends IPackageManager.Stub } } if (outInfo != null) { // Delete the updated package outInfo.isRemovedPackageSystemUpdate = true; if (outInfo.removedChildPackages != null) { Loading @@ -19059,6 +19061,7 @@ public class PackageManagerService extends IPackageManager.Stub } } } } if (disabledPs.versionCode < deletedPs.versionCode) { // Delete data for downgrades Loading Loading @@ -19087,7 +19090,8 @@ public class PackageManagerService extends IPackageManager.Stub if (DEBUG_REMOVE) Slog.d(TAG, "Re-installing system package: " + disabledPs); try { installPackageFromSystemLIF(disabledPs.codePathString, allUserHandles, outInfo.origUsers, deletedPs.getPermissionsState(), writeSettings); outInfo == null ? null : outInfo.origUsers, deletedPs.getPermissionsState(), writeSettings); } catch (PackageManagerException e) { Slog.w(TAG, "Failed to restore system package:" + deletedPkg.packageName + ": " + e.getMessage()); Loading Loading @@ -22939,9 +22943,9 @@ public class PackageManagerService extends IPackageManager.Stub mSettings.writeKernelMappingLPr(ps); } final UserManager um = mContext.getSystemService(UserManager.class); final UserManagerService um = sUserManager; UserManagerInternal umInternal = getUserManagerInternal(); for (UserInfo user : um.getUsers()) { for (UserInfo user : um.getUsers(false /* excludeDying */)) { final int flags; if (umInternal.isUserUnlockingOrUnlocked(user.id)) { flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE; Loading Loading @@ -23624,8 +23628,9 @@ public class PackageManagerService extends IPackageManager.Stub continue; } final String packageName = ps.pkg.packageName; // Skip over if system app if ((ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0) { // Skip over if system app or static shared library if ((ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0 || !TextUtils.isEmpty(ps.pkg.staticSharedLibName)) { continue; } if (DEBUG_CLEAN_APKS) { Loading
services/core/java/com/android/server/pm/PackageManagerService.java +27 −22 Original line number Diff line number Diff line Loading @@ -18605,7 +18605,7 @@ public class PackageManagerService extends IPackageManager.Stub continue; } List<VersionedPackage> libClientPackages = getPackagesUsingSharedLibraryLPr( libraryInfo, 0, currUserId); libraryInfo, MATCH_KNOWN_PACKAGES, currUserId); if (!ArrayUtils.isEmpty(libClientPackages)) { Slog.w(TAG, "Not removing package " + pkg.manifestPackageName + " hosting lib " + libraryInfo.getName() + " version " Loading Loading @@ -19018,10 +19018,11 @@ public class PackageManagerService extends IPackageManager.Stub * Tries to delete system package. */ 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 { final boolean applyUserRestrictions = (allUserHandles != null) && (outInfo.origUsers != null); final boolean applyUserRestrictions = (allUserHandles != null) && outInfo != null && (outInfo.origUsers != null); final PackageParser.Package deletedPkg = deletedPs.pkg; // Confirm if the system package has been updated // An updated system app can be deleted. This will also have to restore Loading @@ -19042,6 +19043,7 @@ public class PackageManagerService extends IPackageManager.Stub } } if (outInfo != null) { // Delete the updated package outInfo.isRemovedPackageSystemUpdate = true; if (outInfo.removedChildPackages != null) { Loading @@ -19059,6 +19061,7 @@ public class PackageManagerService extends IPackageManager.Stub } } } } if (disabledPs.versionCode < deletedPs.versionCode) { // Delete data for downgrades Loading Loading @@ -19087,7 +19090,8 @@ public class PackageManagerService extends IPackageManager.Stub if (DEBUG_REMOVE) Slog.d(TAG, "Re-installing system package: " + disabledPs); try { installPackageFromSystemLIF(disabledPs.codePathString, allUserHandles, outInfo.origUsers, deletedPs.getPermissionsState(), writeSettings); outInfo == null ? null : outInfo.origUsers, deletedPs.getPermissionsState(), writeSettings); } catch (PackageManagerException e) { Slog.w(TAG, "Failed to restore system package:" + deletedPkg.packageName + ": " + e.getMessage()); Loading Loading @@ -22939,9 +22943,9 @@ public class PackageManagerService extends IPackageManager.Stub mSettings.writeKernelMappingLPr(ps); } final UserManager um = mContext.getSystemService(UserManager.class); final UserManagerService um = sUserManager; UserManagerInternal umInternal = getUserManagerInternal(); for (UserInfo user : um.getUsers()) { for (UserInfo user : um.getUsers(false /* excludeDying */)) { final int flags; if (umInternal.isUserUnlockingOrUnlocked(user.id)) { flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE; Loading Loading @@ -23624,8 +23628,9 @@ public class PackageManagerService extends IPackageManager.Stub continue; } final String packageName = ps.pkg.packageName; // Skip over if system app if ((ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0) { // Skip over if system app or static shared library if ((ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0 || !TextUtils.isEmpty(ps.pkg.staticSharedLibName)) { continue; } if (DEBUG_CLEAN_APKS) {