| Index: dbus_service.cc
|
| diff --git a/dbus_service.cc b/dbus_service.cc
|
| index 54dde41e0de827c8a5cc29ccb21e43573cdef615..4a05160eb234bae50433a59eed2e2a6d988330f5 100644
|
| --- a/dbus_service.cc
|
| +++ b/dbus_service.cc
|
| @@ -47,6 +47,24 @@ UpdateEngineService* update_engine_service_new(void) {
|
| g_object_new(UPDATE_ENGINE_TYPE_SERVICE, NULL));
|
| }
|
|
|
| +gboolean update_engine_service_attempt_update(UpdateEngineService* self,
|
| + gchar* app_version,
|
| + gchar* omaha_url,
|
| + GError **error) {
|
| + const string update_app_version = app_version ? app_version : "";
|
| + const string update_omaha_url = omaha_url ? omaha_url : "";
|
| + LOG(INFO) << "Attempt update: app_version=\"" << update_app_version << "\" "
|
| + << "omaha_url=\"" << update_omaha_url << "\"";
|
| + self->update_attempter_->CheckForUpdate(app_version, omaha_url);
|
| + return TRUE;
|
| +}
|
| +
|
| +gboolean update_engine_service_check_for_update(UpdateEngineService* self,
|
| + GError **error) {
|
| + self->update_attempter_->CheckForUpdate("", "");
|
| + return TRUE;
|
| +}
|
| +
|
| gboolean update_engine_service_get_status(UpdateEngineService* self,
|
| int64_t* last_checked_time,
|
| double* progress,
|
| @@ -68,21 +86,12 @@ gboolean update_engine_service_get_status(UpdateEngineService* self,
|
| return TRUE;
|
| }
|
|
|
| -gboolean update_engine_service_attempt_update(UpdateEngineService* self,
|
| - gchar* app_version,
|
| - gchar* omaha_url,
|
| - GError **error) {
|
| - const string update_app_version = app_version ? app_version : "";
|
| - const string update_omaha_url = omaha_url ? omaha_url : "";
|
| - LOG(INFO) << "Attempt update: app_version=\"" << update_app_version << "\" "
|
| - << "omaha_url=\"" << update_omaha_url << "\"";
|
| - self->update_attempter_->CheckForUpdate(app_version, omaha_url);
|
| - return TRUE;
|
| -}
|
| -
|
| -gboolean update_engine_service_check_for_update(UpdateEngineService* self,
|
| +gboolean update_engine_service_reboot_if_needed(UpdateEngineService* self,
|
| GError **error) {
|
| - self->update_attempter_->CheckForUpdate("", "");
|
| + if (!self->update_attempter_->RebootIfNeeded()) {
|
| + *error = NULL;
|
| + return FALSE;
|
| + }
|
| return TRUE;
|
| }
|
|
|
|
|