Return correct error code when source operation hash mismatch.
Now it returns kDownloadStateInitializationError.
Test: delta update on a modified system.
Bug: 28769126
Bug: 30510360
(cherry picked from commit be2c47bad96b46985bdcedceabbe6baa1f8a23f5)
Change-Id: I57fb48553b3fc88ef19ba55f9b5886ef1338282a
diff --git a/payload_consumer/delta_performer.h b/payload_consumer/delta_performer.h
index 0a60020..fdfcb5b 100644
--- a/payload_consumer/delta_performer.h
+++ b/payload_consumer/delta_performer.h
@@ -250,12 +250,16 @@
bool PerformInstallOperation(const InstallOperation& operation);
// These perform a specific type of operation and return true on success.
+ // |error| will be set if source hash mismatch, otherwise |error| might not be
+ // set even if it fails.
bool PerformReplaceOperation(const InstallOperation& operation);
bool PerformZeroOrDiscardOperation(const InstallOperation& operation);
bool PerformMoveOperation(const InstallOperation& operation);
bool PerformBsdiffOperation(const InstallOperation& operation);
- bool PerformSourceCopyOperation(const InstallOperation& operation);
- bool PerformSourceBsdiffOperation(const InstallOperation& operation);
+ bool PerformSourceCopyOperation(const InstallOperation& operation,
+ ErrorCode* error);
+ bool PerformSourceBsdiffOperation(const InstallOperation& operation,
+ ErrorCode* error);
// Extracts the payload signature message from the blob on the |operation| if
// the offset matches the one specified by the manifest. Returns whether the