Update API: initial support
Initial pieces of the Update API callback framework.
- move the status callback params to a new object, UpdateEngineStatus to
allow for the easier addition of new params in the future.
- switch the IUpdateEngineStatusCallback to provide a
ParcelableUpdateEngineStatus instead of a series of individual params
- move the various GetStatus() methods to use the UpdateEngineStatus
object instead of a series of params (which will need future expansion)
- Add current and new product/os versions to both the UpdateEngineStatus
and the ParcelableUpdateEngineStatus.
Bug: 64808702
Test: unit tests, and performing OTAs via a test app calling
IUpdateEngine::AttemptUpdate() via UpdateManager::performUpdateNow()
Change-Id: I53f66f3511049f0809855814e1e758023cd8cc08
(cherry picked from commit 4f96ebf85022837603f2e10100a044d234b7d86f)
diff --git a/client_library/client_binder.cc b/client_library/client_binder.cc
index e98c225..fecd9a3 100644
--- a/client_library/client_binder.cc
+++ b/client_library/client_binder.cc
@@ -143,18 +143,18 @@
}
Status BinderUpdateEngineClient::StatusUpdateCallback::HandleStatusUpdate(
- int64_t last_checked_time,
- double progress,
- const String16& current_operation,
- const String16& new_version,
- int64_t new_size) {
+ const ParcelableUpdateEngineStatus& status) {
UpdateStatus update_status;
- StringToUpdateStatus(String8{current_operation}.string(), &update_status);
+ StringToUpdateStatus(String8{status.current_operation_}.string(),
+ &update_status);
for (auto& handler : client_->handlers_) {
- handler->HandleStatusUpdate(last_checked_time, progress, update_status,
- String8{new_version}.string(), new_size);
+ handler->HandleStatusUpdate(status.last_checked_time_,
+ status.progress_,
+ update_status,
+ String8{status.new_version_}.string(),
+ status.new_size_);
}
return Status::ok();