blob: e6f4628d792b12d99afcef1ab799136fe0f69336 [file] [log] [blame]
Alex Deymoaea4c1c2015-08-19 20:24:43 -07001//
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 Arnold55f39b72014-01-28 12:51:45 -080016
Gilad Arnold48415f12014-06-27 07:10:58 -070017#ifndef UPDATE_ENGINE_UPDATE_MANAGER_SHILL_PROVIDER_H_
18#define UPDATE_ENGINE_UPDATE_MANAGER_SHILL_PROVIDER_H_
Gilad Arnold55f39b72014-01-28 12:51:45 -080019
Alex Vakulenko75039d72014-03-25 12:36:28 -070020#include <base/time/time.h>
Gilad Arnold55f39b72014-01-28 12:51:45 -080021
Sen Jiang255e22b2016-05-20 16:15:29 -070022#include "update_engine/connection_utils.h"
Alex Deymo63784a52014-05-28 10:46:14 -070023#include "update_engine/update_manager/provider.h"
24#include "update_engine/update_manager/variable.h"
Gilad Arnold55f39b72014-01-28 12:51:45 -080025
Alex Deymo63784a52014-05-28 10:46:14 -070026namespace chromeos_update_manager {
Gilad Arnold55f39b72014-01-28 12:51:45 -080027
Gilad Arnold55f39b72014-01-28 12:51:45 -080028// Provider for networking related information.
29class ShillProvider : public Provider {
30 public:
Alex Deymo610277e2014-11-11 21:18:11 -080031 ~ShillProvider() override {}
David Zeuthen21716e22014-04-23 15:42:05 -070032
Gilad Arnoldef120fa2014-04-09 12:52:10 -070033 // A variable returning whether we currently have network connectivity.
Gilad Arnolddf3dd242014-04-09 07:15:51 -070034 virtual Variable<bool>* var_is_connected() = 0;
Gilad Arnold55f39b72014-01-28 12:51:45 -080035
Gilad Arnoldef120fa2014-04-09 12:52:10 -070036 // A variable returning the current network connection type. Unknown if not
37 // connected.
Sen Jiang255e22b2016-05-20 16:15:29 -070038 virtual Variable<chromeos_update_engine::ConnectionType>* var_conn_type() = 0;
Gilad Arnold55f39b72014-01-28 12:51:45 -080039
Gilad Arnoldef120fa2014-04-09 12:52:10 -070040 // A variable returning the tethering mode of a network connection. Unknown if
41 // not connected.
Sen Jiang255e22b2016-05-20 16:15:29 -070042 virtual Variable<chromeos_update_engine::ConnectionTethering>*
43 var_conn_tethering() = 0;
Gilad Arnoldef120fa2014-04-09 12:52:10 -070044
Alex Vakulenko072359c2014-07-18 11:41:07 -070045 // A variable returning the time when network connection last changed.
Gilad Arnoldef120fa2014-04-09 12:52:10 -070046 // Initialized to current time.
Gilad Arnolddf3dd242014-04-09 07:15:51 -070047 virtual Variable<base::Time>* var_conn_last_changed() = 0;
Gilad Arnold55f39b72014-01-28 12:51:45 -080048
49 protected:
50 ShillProvider() {}
David Zeuthen21716e22014-04-23 15:42:05 -070051
52 private:
53 DISALLOW_COPY_AND_ASSIGN(ShillProvider);
Gilad Arnold55f39b72014-01-28 12:51:45 -080054};
55
Alex Deymo63784a52014-05-28 10:46:14 -070056} // namespace chromeos_update_manager
Gilad Arnold55f39b72014-01-28 12:51:45 -080057
Gilad Arnold48415f12014-06-27 07:10:58 -070058#endif // UPDATE_ENGINE_UPDATE_MANAGER_SHILL_PROVIDER_H_