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.
|
* Tries to delete system package.
|
||||||
*/
|
*/
|
||||||
private boolean deleteSystemPackageLIF(PackageParser.Package deletedPkg,
|
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) {
|
boolean writeSettings) {
|
||||||
if (deletedPs.parentPackageName != null) {
|
if (deletedPs.parentPackageName != null) {
|
||||||
Slog.w(TAG, "Attempt to delete child system package " + deletedPkg.packageName);
|
Slog.w(TAG, "Attempt to delete child system package " + deletedPkg.packageName);
|
||||||
@@ -19366,7 +19367,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
final boolean applyUserRestrictions
|
final boolean applyUserRestrictions
|
||||||
= (allUserHandles != null) && (outInfo.origUsers != null);
|
= (allUserHandles != null) && outInfo != null && (outInfo.origUsers != null);
|
||||||
final PackageSetting disabledPs;
|
final PackageSetting disabledPs;
|
||||||
// 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
|
||||||
@@ -19396,19 +19397,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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user