Skip invalid DefaultService object path values.
If shill sends an invalid DefaultService object path value, we need to
explicitly treat since otherwise the DBus library will abort the
program when trying to send a message to the invalid object path.
Bug: chromium:526446
Change-Id: Id91787916b62cd94dab38532b98be0f0a8b6d4c4
Test: Added unittests
diff --git a/connection_manager.h b/connection_manager.h
index cb638b6..2057f3b 100644
--- a/connection_manager.h
+++ b/connection_manager.h
@@ -20,6 +20,7 @@
#include <string>
#include <base/macros.h>
+#include <dbus/object_path.h>
#include "update_engine/connection_manager_interface.h"
#include "update_engine/shill_proxy_interface.h"
@@ -52,9 +53,9 @@
private:
// Returns (via out_path) the default network path, or empty string if
// there's no network up. Returns true on success.
- bool GetDefaultServicePath(std::string* out_path);
+ bool GetDefaultServicePath(dbus::ObjectPath* out_path);
- bool GetServicePathProperties(const std::string& path,
+ bool GetServicePathProperties(const dbus::ObjectPath& path,
NetworkConnectionType* out_type,
NetworkTethering* out_tethering);