Add support to update_engine_client for -app_version and -omaha_url.
These options prevent auto-detection of these parameters.
Note that this CL makes the check_for_update DBus method obsolete from
the client's point of view.
BUG=4593
TEST=unit tests, gmerged on device and tried the client with different options.
Review URL: http://codereview.chromium.org/3048008
diff --git a/update_attempter.h b/update_attempter.h
index 269edec..3e47969 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -51,7 +51,10 @@
if (utils::FileExists(kUpdateCompletedMarker))
status_ = UPDATE_STATUS_UPDATED_NEED_REBOOT;
}
- void Update();
+ // Checks for update and, if a newer version is available, attempts
+ // to update the system. Non-empty |in_app_version| or
+ // |in_update_url| prevents automatic detection of the parameter.
+ void Update(const std::string& app_version, const std::string& omaha_url);
// ActionProcessorDelegate methods:
void ProcessingDone(const ActionProcessor* processor, ActionExitCode code);
@@ -78,7 +81,10 @@
dbus_service_ = dbus_service;
}
- void CheckForUpdate();
+ // This is the D-Bus service entry point for going through an
+ // update. If the current status is idle invokes Update.
+ void CheckForUpdate(const std::string& app_version,
+ const std::string& omaha_url);
// DownloadActionDelegate method
void BytesReceived(uint64_t bytes_received, uint64_t total);