Update engine should use the release channel policy if it exists.
The release channel (aka update track) can be specified by a device
policy. When this is the case, the update engine should use the
value specified by the policy instead of the value specified in
/etc/lsb-release.
BUG=chromium-os:17015
TEST=Added two new tests:
- Added test that OmahaRequestParams uses the release channel passed
in to it when the value is valid, and otherwise uses /etc/lsb-release.
- Added test that the update engine correctly picks up the release
channel that's specified by the policy.
Change-Id: I2fe03712220bb3286476b12cd1f1b330ad006d7c
Reviewed-on: http://gerrit.chromium.org/gerrit/5072
Tested-by: Patrick Dubroy <dubroy@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
diff --git a/update_attempter.h b/update_attempter.h
index 726685e..46dd41c 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -25,6 +25,10 @@
class MetricsLibraryInterface;
struct UpdateEngineService;
+namespace policy {
+ class PolicyProvider;
+}
+
namespace chromeos_update_engine {
class UpdateCheckScheduler;
@@ -140,6 +144,7 @@
FRIEND_TEST(UpdateAttempterTest, CreatePendingErrorEventResumedTest);
FRIEND_TEST(UpdateAttempterTest, DisableDeltaUpdateIfNeededTest);
FRIEND_TEST(UpdateAttempterTest, MarkDeltaUpdateFailureTest);
+ FRIEND_TEST(UpdateAttempterTest, ReadTrackFromPolicy);
FRIEND_TEST(UpdateAttempterTest, PingOmahaTest);
FRIEND_TEST(UpdateAttempterTest, ScheduleErrorEventActionNoEventTest);
FRIEND_TEST(UpdateAttempterTest, ScheduleErrorEventActionTest);
@@ -286,6 +291,9 @@
// True if the action processor needs to be started by the boot flag updater.
bool start_action_processor_;
+ // Used for fetching information about the device policy.
+ scoped_ptr<policy::PolicyProvider> policy_provider_;
+
DISALLOW_COPY_AND_ASSIGN(UpdateAttempter);
};