Merge "Clear BCB if space allocation failed"

This commit is contained in:
Treehugger Robot
2022-02-24 18:58:21 +00:00
committed by Gerrit Code Review

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();
} }