Add a feature to get the last UpdateAttempt ErrorCode from update_engine
For autotest, update_engine test failures are always hard to debug,
since the error message is not clear. Add a new flag 'last_attempt_error'
to get the last UpdateAttempt ErrorCode from update_engine.
Bug:25598547
Test:emerge-peppy update_engine
emerge-peppy update_engine_client
cros flash a test image to DUT.
(on the DUT):update_engine_client --last_attempt_error
Compare the results with the update_engine logs, matched.
Change-Id: Id12681097ed30b0826cad68809f17f934a07e5b2
diff --git a/dbus_service.h b/dbus_service.h
index b0c68e5..1486e3c 100644
--- a/dbus_service.h
+++ b/dbus_service.h
@@ -129,6 +129,10 @@
bool GetRollbackPartition(brillo::ErrorPtr* error,
std::string* out_rollback_partition_name) override;
+ // Returns the last UpdateAttempt error. If not updated yet, default success
+ // ErrorCode will be returned.
+ bool GetLastAttemptError(brillo::ErrorPtr* error,
+ int32_t* out_last_attempt_error) override;
private:
std::unique_ptr<UpdateEngineService> common_;
};