Move ParseConnection*() to connection_utils.
We don't need real_shill_provider if USE_DBUS is 0, but we still need
these functions, and they have a duplicate copy in connection_manager,
so put them in utils and deduplicate.
Also moved StringForConnectionType() to connection_utils.
Bug: 28800946
Test: mma
Change-Id: If535fdc52bc8fb267921bea02b31d8d6580d5d54
diff --git a/connection_manager.h b/connection_manager.h
index 2057f3b..1143f83 100644
--- a/connection_manager.h
+++ b/connection_manager.h
@@ -34,10 +34,6 @@
// TODO(deymo): Remove this class and use ShillProvider from the UpdateManager.
class ConnectionManager : public ConnectionManagerInterface {
public:
- // Returns the string representation corresponding to the given
- // connection type.
- static const char* StringForConnectionType(NetworkConnectionType type);
-
// Constructs a new ConnectionManager object initialized with the
// given system state.
ConnectionManager(ShillProxyInterface* shill_proxy,
@@ -45,10 +41,10 @@
~ConnectionManager() override = default;
// ConnectionManagerInterface overrides.
- bool GetConnectionProperties(NetworkConnectionType* out_type,
- NetworkTethering* out_tethering) override;
- bool IsUpdateAllowedOver(NetworkConnectionType type,
- NetworkTethering tethering) const override;
+ bool GetConnectionProperties(ConnectionType* out_type,
+ ConnectionTethering* out_tethering) override;
+ bool IsUpdateAllowedOver(ConnectionType type,
+ ConnectionTethering tethering) const override;
private:
// Returns (via out_path) the default network path, or empty string if
@@ -56,8 +52,8 @@
bool GetDefaultServicePath(dbus::ObjectPath* out_path);
bool GetServicePathProperties(const dbus::ObjectPath& path,
- NetworkConnectionType* out_type,
- NetworkTethering* out_tethering);
+ ConnectionType* out_type,
+ ConnectionTethering* out_tethering);
// The mockable interface to access the shill DBus proxies.
ShillProxyInterface* shill_proxy_;