AU: Implement switching of tracks through SetTrack.
On official images, update engine allows updating the track
only to dev-channel or beta-channel. The track is verified
both at setting and at getting time.
BUG=8104
TEST=unit test; tested on device
Change-Id: Ic81d4e3a9e09554d2239ee5c7a6c78e4dfe30d19
Review URL: http://codereview.chromium.org/4103002
diff --git a/dbus_service.cc b/dbus_service.cc
index 447a900..5a46b51 100644
--- a/dbus_service.cc
+++ b/dbus_service.cc
@@ -9,6 +9,7 @@
#include <base/logging.h>
#include "update_engine/marshal.glibmarshal.h"
+#include "update_engine/omaha_request_params.h"
#include "update_engine/utils.h"
using std::string;
@@ -111,7 +112,12 @@
gchar* track,
GError **error) {
if (track) {
- LOG(INFO) << "TODO: Setting track to: " << track;
+ LOG(INFO) << "Setting track to: " << track;
+ if (!chromeos_update_engine::OmahaRequestDeviceParams::SetDeviceTrack(
+ track)) {
+ *error = NULL;
+ return FALSE;
+ }
}
return TRUE;
}