blob: 0053fedb1f7c9d1314b5f7650af5aefc7efbd3c3 [file] [log] [blame]
Jay Srinivasan43488792012-06-19 00:25:31 -07001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include <base/file_util.h>
6
7#include "update_engine/system_state.h"
8
9namespace chromeos_update_engine {
10
11static const char kOOBECompletedMarker[] = "/home/chronos/.oobe_completed";
12
Jay Srinivasan34b5d862012-07-23 11:43:22 -070013RealSystemState::RealSystemState()
14 : device_policy_(NULL),
Jay Srinivasanf0572052012-10-23 18:12:56 -070015 connection_manager_(this),
16 metrics_lib_(NULL) {}
Jay Srinivasan43488792012-06-19 00:25:31 -070017
18bool RealSystemState::IsOOBEComplete() {
19 return file_util::PathExists(FilePath(kOOBECompletedMarker));
20}
21
22void RealSystemState::SetDevicePolicy(
23 const policy::DevicePolicy* device_policy) {
24 device_policy_ = device_policy;
25}
26
27const policy::DevicePolicy* RealSystemState::GetDevicePolicy() const {
28 return device_policy_;
29}
30
31ConnectionManager* RealSystemState::GetConnectionManager() {
32 return &connection_manager_;
33}
34
Jay Srinivasanf0572052012-10-23 18:12:56 -070035void RealSystemState::set_metrics_lib(MetricsLibraryInterface* metrics_lib) {
36 metrics_lib_ = metrics_lib;
37}
38
39MetricsLibraryInterface* RealSystemState::metrics_lib() {
40 return metrics_lib_;
41}
42
Jay Srinivasan43488792012-06-19 00:25:31 -070043} // namespace chromeos_update_engine