1aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo//
2aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo// Copyright (C) 2015 The Android Open Source Project
3aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo//
4aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo// Licensed under the Apache License, Version 2.0 (the "License");
5aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo// you may not use this file except in compliance with the License.
6aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo// You may obtain a copy of the License at
7aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo//
8aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo//      http://www.apache.org/licenses/LICENSE-2.0
9aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo//
10aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo// Unless required by applicable law or agreed to in writing, software
11aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo// distributed under the License is distributed on an "AS IS" BASIS,
12aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo// See the License for the specific language governing permissions and
14aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo// limitations under the License.
15aea4c1cea20dda7ae7e85fc8924a2d784f70d806Alex Deymo//
16305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
17305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo#ifndef UPDATE_ENGINE_SHILL_PROXY_INTERFACE_H_
18305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo#define UPDATE_ENGINE_SHILL_PROXY_INTERFACE_H_
19305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
20305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo#include <memory>
21305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo#include <string>
22305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
23305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo#include <base/macros.h>
24758dd53cf503adbcb049909f25f54603d411be09Alex Deymo#include <dbus/object_path.h>
25d6deb1d0357f47d5525bfaeffa6c201b19abd3e7Alex Deymo#include <shill/dbus-proxies.h>
26305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
27305345001d85ca2282112c2a30fe75c7a4773491Alex Deymonamespace chromeos_update_engine {
28305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
29305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo// This class handles the DBus connection with shill daemon. The DBus interface
30305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo// with shill requires to monitor or request the current service by interacting
31305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo// with the org::chromium::flimflam::ManagerProxy and then request or monitor
32305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo// properties on the selected org::chromium::flimflam::ServiceProxy. This class
33305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo// provides a mockable way to access that.
34305345001d85ca2282112c2a30fe75c7a4773491Alex Deymoclass ShillProxyInterface {
35305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo public:
36305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo  virtual ~ShillProxyInterface() = default;
37305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
38305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo  // Return the ManagerProxy instance of the shill daemon. The instance is owned
39305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo  // by this ShillProxyInterface instance.
40305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo  virtual org::chromium::flimflam::ManagerProxyInterface* GetManagerProxy() = 0;
41305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
42305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo  // Return a ServiceProxy for the given path. The ownership of the returned
43305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo  // instance is transferred to the caller.
44305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo  virtual std::unique_ptr<org::chromium::flimflam::ServiceProxyInterface>
45758dd53cf503adbcb049909f25f54603d411be09Alex Deymo  GetServiceForPath(const dbus::ObjectPath& path) = 0;
46305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
47305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo protected:
48305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo  ShillProxyInterface() = default;
49305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
50305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo private:
51305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo  DISALLOW_COPY_AND_ASSIGN(ShillProxyInterface);
52305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo};
53305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
54305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo}  // namespace chromeos_update_engine
55305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo
56305345001d85ca2282112c2a30fe75c7a4773491Alex Deymo#endif  // UPDATE_ENGINE_SHILL_PROXY_INTERFACE_H_
57