| 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 | // | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 16 |  | 
| Gilad Arnold | 48415f1 | 2014-06-27 07:10:58 -0700 | [diff] [blame] | 17 | #ifndef UPDATE_ENGINE_UPDATE_MANAGER_SHILL_PROVIDER_H_ | 
|  | 18 | #define UPDATE_ENGINE_UPDATE_MANAGER_SHILL_PROVIDER_H_ | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 19 |  | 
| Alex Vakulenko | 75039d7 | 2014-03-25 12:36:28 -0700 | [diff] [blame] | 20 | #include <base/time/time.h> | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 21 |  | 
| Sen Jiang | 255e22b | 2016-05-20 16:15:29 -0700 | [diff] [blame] | 22 | #include "update_engine/connection_utils.h" | 
| Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 23 | #include "update_engine/update_manager/provider.h" | 
|  | 24 | #include "update_engine/update_manager/variable.h" | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 25 |  | 
| Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 26 | namespace chromeos_update_manager { | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 27 |  | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 28 | // Provider for networking related information. | 
|  | 29 | class ShillProvider : public Provider { | 
|  | 30 | public: | 
| Alex Deymo | 610277e | 2014-11-11 21:18:11 -0800 | [diff] [blame] | 31 | ~ShillProvider() override {} | 
| David Zeuthen | 21716e2 | 2014-04-23 15:42:05 -0700 | [diff] [blame] | 32 |  | 
| Gilad Arnold | ef120fa | 2014-04-09 12:52:10 -0700 | [diff] [blame] | 33 | // A variable returning whether we currently have network connectivity. | 
| Gilad Arnold | df3dd24 | 2014-04-09 07:15:51 -0700 | [diff] [blame] | 34 | virtual Variable<bool>* var_is_connected() = 0; | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 35 |  | 
| Gilad Arnold | ef120fa | 2014-04-09 12:52:10 -0700 | [diff] [blame] | 36 | // A variable returning the current network connection type. Unknown if not | 
|  | 37 | // connected. | 
| Sen Jiang | 255e22b | 2016-05-20 16:15:29 -0700 | [diff] [blame] | 38 | virtual Variable<chromeos_update_engine::ConnectionType>* var_conn_type() = 0; | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 39 |  | 
| Gilad Arnold | ef120fa | 2014-04-09 12:52:10 -0700 | [diff] [blame] | 40 | // A variable returning the tethering mode of a network connection. Unknown if | 
|  | 41 | // not connected. | 
| Sen Jiang | 255e22b | 2016-05-20 16:15:29 -0700 | [diff] [blame] | 42 | virtual Variable<chromeos_update_engine::ConnectionTethering>* | 
|  | 43 | var_conn_tethering() = 0; | 
| Gilad Arnold | ef120fa | 2014-04-09 12:52:10 -0700 | [diff] [blame] | 44 |  | 
| Alex Vakulenko | 072359c | 2014-07-18 11:41:07 -0700 | [diff] [blame] | 45 | // A variable returning the time when network connection last changed. | 
| Gilad Arnold | ef120fa | 2014-04-09 12:52:10 -0700 | [diff] [blame] | 46 | // Initialized to current time. | 
| Gilad Arnold | df3dd24 | 2014-04-09 07:15:51 -0700 | [diff] [blame] | 47 | virtual Variable<base::Time>* var_conn_last_changed() = 0; | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 48 |  | 
|  | 49 | protected: | 
|  | 50 | ShillProvider() {} | 
| David Zeuthen | 21716e2 | 2014-04-23 15:42:05 -0700 | [diff] [blame] | 51 |  | 
|  | 52 | private: | 
|  | 53 | DISALLOW_COPY_AND_ASSIGN(ShillProvider); | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 54 | }; | 
|  | 55 |  | 
| Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 56 | }  // namespace chromeos_update_manager | 
| Gilad Arnold | 55f39b7 | 2014-01-28 12:51:45 -0800 | [diff] [blame] | 57 |  | 
| Gilad Arnold | 48415f1 | 2014-06-27 07:10:58 -0700 | [diff] [blame] | 58 | #endif  // UPDATE_ENGINE_UPDATE_MANAGER_SHILL_PROVIDER_H_ |