Don't allow rollback on the stable-channel.

This change explicitly disallows rollback on the stable-channel.

BUG=chromium:252539
TEST=unittests + on device.

Change-Id: I71caf95daae185790cf9fb0fda790eaf960bbe6b
Reviewed-on: https://gerrit.chromium.org/gerrit/61687
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index 4104739..8d7e455 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -552,6 +552,17 @@
   // check for != stable-channel here.
   RefreshDevicePolicy();
 
+  // Initialize the default request params.
+  if (!omaha_request_params_->Init("", "", true)) {
+    LOG(ERROR) << "Unable to initialize Omaha request params.";
+    return false;
+  }
+
+  if (omaha_request_params_->current_channel() == "stable-channel") {
+    LOG(ERROR) << "Rollback is not supported while on the stable-channel.";
+    return false;
+  }
+
   LOG(INFO) << "Setting rollback options.";
   InstallPlan install_plan;
   if (install_path == NULL) {
@@ -583,12 +594,6 @@
       new InstallPlanAction(install_plan));
   actions_.push_back(shared_ptr<AbstractAction>(install_plan_action));
 
-  // Initialize the default request params.
-  if (!omaha_request_params_->Init("", "", true)) {
-    LOG(ERROR) << "Unable to initialize Omaha request params.";
-    return false;
-  }
-
   BuildPostInstallActions(install_plan_action.get());
 
   // Enqueue the actions