Alex Deymo | aea4c1c | 2015-08-19 20:24:43 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2014 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 16 | |
Gilad Arnold | 48415f1 | 2014-06-27 07:10:58 -0700 | [diff] [blame] | 17 | #ifndef UPDATE_ENGINE_UPDATE_MANAGER_DEVICE_POLICY_PROVIDER_H_ |
| 18 | #define UPDATE_ENGINE_UPDATE_MANAGER_DEVICE_POLICY_PROVIDER_H_ |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 19 | |
| 20 | #include <set> |
| 21 | #include <string> |
| 22 | |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 23 | #include <base/time/time.h> |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 24 | #include <policy/libpolicy.h> |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 25 | |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 26 | #include "update_engine/update_manager/provider.h" |
| 27 | #include "update_engine/update_manager/shill_provider.h" |
| 28 | #include "update_engine/update_manager/variable.h" |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 29 | |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 30 | namespace chromeos_update_manager { |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 31 | |
| 32 | // Provides access to the current DevicePolicy. |
| 33 | class DevicePolicyProvider : public Provider { |
| 34 | public: |
Alex Deymo | 610277e | 2014-11-11 21:18:11 -0800 | [diff] [blame] | 35 | ~DevicePolicyProvider() override {} |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 36 | |
| 37 | // Variable stating whether the DevicePolicy was loaded. |
| 38 | virtual Variable<bool>* var_device_policy_is_loaded() = 0; |
| 39 | |
| 40 | // Variables mapping the information received on the DevicePolicy protobuf. |
| 41 | virtual Variable<std::string>* var_release_channel() = 0; |
| 42 | |
| 43 | virtual Variable<bool>* var_release_channel_delegated() = 0; |
| 44 | |
| 45 | virtual Variable<bool>* var_update_disabled() = 0; |
| 46 | |
| 47 | virtual Variable<std::string>* var_target_version_prefix() = 0; |
| 48 | |
Gilad Arnold | f62a4b8 | 2014-05-01 07:41:07 -0700 | [diff] [blame] | 49 | // Returns a non-negative scatter interval used for updates. |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 50 | virtual Variable<base::TimeDelta>* var_scatter_factor() = 0; |
| 51 | |
Alex Vakulenko | 072359c | 2014-07-18 11:41:07 -0700 | [diff] [blame] | 52 | // Variable returning the set of connection types allowed for updates. The |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 53 | // identifiers returned are consistent with the ones returned by the |
| 54 | // ShillProvider. |
| 55 | virtual Variable<std::set<ConnectionType>>* |
| 56 | var_allowed_connection_types_for_update() = 0; |
| 57 | |
| 58 | // Variable stating the name of the device owner. For enterprise enrolled |
| 59 | // devices, this will be an empty string. |
Gilad Arnold | ef8d087 | 2014-10-03 14:14:06 -0700 | [diff] [blame] | 60 | virtual Variable<std::string>* var_owner() = 0; |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 61 | |
| 62 | virtual Variable<bool>* var_http_downloads_enabled() = 0; |
| 63 | |
| 64 | virtual Variable<bool>* var_au_p2p_enabled() = 0; |
| 65 | |
| 66 | protected: |
| 67 | DevicePolicyProvider() {} |
| 68 | |
| 69 | private: |
| 70 | DISALLOW_COPY_AND_ASSIGN(DevicePolicyProvider); |
| 71 | }; |
| 72 | |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 73 | } // namespace chromeos_update_manager |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 74 | |
Gilad Arnold | 48415f1 | 2014-06-27 07:10:58 -0700 | [diff] [blame] | 75 | #endif // UPDATE_ENGINE_UPDATE_MANAGER_DEVICE_POLICY_PROVIDER_H_ |