Merge "Clear BCB if space allocation failed" am: b667621f8b

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1997490

Change-Id: Id9e3f312578a322784d8e80025ee72ac1419bf57
This commit is contained in:
Treehugger Robot
2022-02-24 19:31:36 +00:00
committed by Automerger Merge Worker

View File

@@ -674,10 +674,12 @@ public class RecoverySystem {
} }
try { try {
if (!rs.allocateSpaceForUpdate(packageFile)) { if (!rs.allocateSpaceForUpdate(packageFile)) {
rs.clearBcb();
throw new IOException("Failed to allocate space for update " throw new IOException("Failed to allocate space for update "
+ packageFile.getAbsolutePath()); + packageFile.getAbsolutePath());
} }
} catch (RemoteException e) { } catch (RemoteException e) {
rs.clearBcb();
e.rethrowAsRuntimeException(); e.rethrowAsRuntimeException();
} }