Appropriately sets all installs on *any* failure of one
During multi-package install, this change ensures that all of the install results have their reason set to a value besides INSTALL_SUCCEEDED to avoid post install steps treating them as if they were successfully installed. Test: atest com.android.tests.atomicinstall.AtomicInstallTest#testEarlyFailureFailsAll Fixes: 133380744 Change-Id: I60b5c5376a27979d3fa4dfb67914dbd3573e280b
This commit is contained in:
@@ -17071,6 +17071,13 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
cleanUpAppIdCreation(result);
|
||||
}
|
||||
}
|
||||
// TODO(patb): create a more descriptive reason than unknown in future release
|
||||
// mark all non-failure installs as UNKNOWN so we do not treat them as success
|
||||
for (InstallRequest request : requests) {
|
||||
if (request.installResult.returnCode == PackageManager.INSTALL_SUCCEEDED) {
|
||||
request.installResult.returnCode = PackageManager.INSTALL_UNKNOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (PrepareResult result : prepareResults.values()) {
|
||||
if (result.freezer != null) {
|
||||
|
||||
Reference in New Issue
Block a user