blob: b0b9d368652118b07ff12b0fe4458e91d2f0d279 [file] [log] [blame]
Alex Deymoc83baf62014-04-02 17:43:35 -07001// Copyright (c) 2014 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
Gilad Arnold48415f12014-06-27 07:10:58 -07005#ifndef UPDATE_ENGINE_UPDATE_MANAGER_DEVICE_POLICY_PROVIDER_H_
6#define UPDATE_ENGINE_UPDATE_MANAGER_DEVICE_POLICY_PROVIDER_H_
Alex Deymoc83baf62014-04-02 17:43:35 -07007
8#include <set>
9#include <string>
10
Alex Deymoc83baf62014-04-02 17:43:35 -070011#include <base/time/time.h>
Alex Deymo63784a52014-05-28 10:46:14 -070012#include <policy/libpolicy.h>
Alex Deymoc83baf62014-04-02 17:43:35 -070013
Alex Deymo63784a52014-05-28 10:46:14 -070014#include "update_engine/update_manager/provider.h"
15#include "update_engine/update_manager/shill_provider.h"
16#include "update_engine/update_manager/variable.h"
Alex Deymoc83baf62014-04-02 17:43:35 -070017
Alex Deymo63784a52014-05-28 10:46:14 -070018namespace chromeos_update_manager {
Alex Deymoc83baf62014-04-02 17:43:35 -070019
20// Provides access to the current DevicePolicy.
21class DevicePolicyProvider : public Provider {
22 public:
23 virtual ~DevicePolicyProvider() {}
24
25 // Variable stating whether the DevicePolicy was loaded.
26 virtual Variable<bool>* var_device_policy_is_loaded() = 0;
27
28 // Variables mapping the information received on the DevicePolicy protobuf.
29 virtual Variable<std::string>* var_release_channel() = 0;
30
31 virtual Variable<bool>* var_release_channel_delegated() = 0;
32
33 virtual Variable<bool>* var_update_disabled() = 0;
34
35 virtual Variable<std::string>* var_target_version_prefix() = 0;
36
Gilad Arnoldf62a4b82014-05-01 07:41:07 -070037 // Returns a non-negative scatter interval used for updates.
Alex Deymoc83baf62014-04-02 17:43:35 -070038 virtual Variable<base::TimeDelta>* var_scatter_factor() = 0;
39
Alex Vakulenko072359c2014-07-18 11:41:07 -070040 // Variable returning the set of connection types allowed for updates. The
Alex Deymoc83baf62014-04-02 17:43:35 -070041 // identifiers returned are consistent with the ones returned by the
42 // ShillProvider.
43 virtual Variable<std::set<ConnectionType>>*
44 var_allowed_connection_types_for_update() = 0;
45
46 // Variable stating the name of the device owner. For enterprise enrolled
47 // devices, this will be an empty string.
Gilad Arnoldef8d0872014-10-03 14:14:06 -070048 virtual Variable<std::string>* var_owner() = 0;
Alex Deymoc83baf62014-04-02 17:43:35 -070049
50 virtual Variable<bool>* var_http_downloads_enabled() = 0;
51
52 virtual Variable<bool>* var_au_p2p_enabled() = 0;
53
54 protected:
55 DevicePolicyProvider() {}
56
57 private:
58 DISALLOW_COPY_AND_ASSIGN(DevicePolicyProvider);
59};
60
Alex Deymo63784a52014-05-28 10:46:14 -070061} // namespace chromeos_update_manager
Alex Deymoc83baf62014-04-02 17:43:35 -070062
Gilad Arnold48415f12014-06-27 07:10:58 -070063#endif // UPDATE_ENGINE_UPDATE_MANAGER_DEVICE_POLICY_PROVIDER_H_