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 //
16 
17 #ifndef UPDATE_ENGINE_UPDATE_MANAGER_SHILL_PROVIDER_H_
18 #define UPDATE_ENGINE_UPDATE_MANAGER_SHILL_PROVIDER_H_
19 
20 #include <base/time/time.h>
21 
22 #include "update_engine/connection_utils.h"
23 #include "update_engine/update_manager/provider.h"
24 #include "update_engine/update_manager/variable.h"
25 
26 namespace chromeos_update_manager {
27 
28 // Provider for networking related information.
29 class ShillProvider : public Provider {
30  public:
~ShillProvider()31   ~ShillProvider() override {}
32 
33   // A variable returning whether we currently have network connectivity.
34   virtual Variable<bool>* var_is_connected() = 0;
35 
36   // A variable returning the current network connection type. Unknown if not
37   // connected.
38   virtual Variable<chromeos_update_engine::ConnectionType>* var_conn_type() = 0;
39 
40   // A variable returning the tethering mode of a network connection. Unknown if
41   // not connected.
42   virtual Variable<chromeos_update_engine::ConnectionTethering>*
43   var_conn_tethering() = 0;
44 
45   // A variable returning the time when network connection last changed.
46   // Initialized to current time.
47   virtual Variable<base::Time>* var_conn_last_changed() = 0;
48 
49  protected:
ShillProvider()50   ShillProvider() {}
51 
52  private:
53   DISALLOW_COPY_AND_ASSIGN(ShillProvider);
54 };
55 
56 }  // namespace chromeos_update_manager
57 
58 #endif  // UPDATE_ENGINE_UPDATE_MANAGER_SHILL_PROVIDER_H_
59