Handles null outInfo in deleteSystemPackageLI am: 6afabce549
Change-Id: I077e6febea84013403feb65842ae99bc449ac737
This commit is contained in:
@@ -19358,7 +19358,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
* Tries to delete system package.
|
||||
*/
|
||||
private boolean deleteSystemPackageLIF(PackageParser.Package deletedPkg,
|
||||
PackageSetting deletedPs, int[] allUserHandles, int flags, PackageRemovedInfo outInfo,
|
||||
PackageSetting deletedPs, int[] allUserHandles, int flags,
|
||||
@Nullable PackageRemovedInfo outInfo,
|
||||
boolean writeSettings) {
|
||||
if (deletedPs.parentPackageName != null) {
|
||||
Slog.w(TAG, "Attempt to delete child system package " + deletedPkg.packageName);
|
||||
@@ -19366,7 +19367,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
}
|
||||
|
||||
final boolean applyUserRestrictions
|
||||
= (allUserHandles != null) && (outInfo.origUsers != null);
|
||||
= (allUserHandles != null) && outInfo != null && (outInfo.origUsers != null);
|
||||
final PackageSetting disabledPs;
|
||||
// Confirm if the system package has been updated
|
||||
// An updated system app can be deleted. This will also have to restore
|
||||
@@ -19396,19 +19397,21 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
}
|
||||
}
|
||||
|
||||
// Delete the updated package
|
||||
outInfo.isRemovedPackageSystemUpdate = true;
|
||||
if (outInfo.removedChildPackages != null) {
|
||||
final int childCount = (deletedPs.childPackageNames != null)
|
||||
? deletedPs.childPackageNames.size() : 0;
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
String childPackageName = deletedPs.childPackageNames.get(i);
|
||||
if (disabledPs.childPackageNames != null && disabledPs.childPackageNames
|
||||
.contains(childPackageName)) {
|
||||
PackageRemovedInfo childInfo = outInfo.removedChildPackages.get(
|
||||
childPackageName);
|
||||
if (childInfo != null) {
|
||||
childInfo.isRemovedPackageSystemUpdate = true;
|
||||
if (outInfo != null) {
|
||||
// Delete the updated package
|
||||
outInfo.isRemovedPackageSystemUpdate = true;
|
||||
if (outInfo.removedChildPackages != null) {
|
||||
final int childCount = (deletedPs.childPackageNames != null)
|
||||
? deletedPs.childPackageNames.size() : 0;
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
String childPackageName = deletedPs.childPackageNames.get(i);
|
||||
if (disabledPs.childPackageNames != null && disabledPs.childPackageNames
|
||||
.contains(childPackageName)) {
|
||||
PackageRemovedInfo childInfo = outInfo.removedChildPackages.get(
|
||||
childPackageName);
|
||||
if (childInfo != null) {
|
||||
childInfo.isRemovedPackageSystemUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user