Handle not connected message from shill.
When shill is not connected it exposes the service path / as the default
service path. Nevertheless, this service path doesn't implement the
org.chromium.flimflam.Service interface, so we can't call any method
there. This patch handles this situation removing the misleading
error messages from the logs.
Bug: None
Change-Id: Id936584235d25914d5a2d44e88aeb54703dc376b
Test: Applied a payload, no more GetProperties() errors when not connected.
diff --git a/connection_manager.cc b/connection_manager.cc
index 0a1fcf2..4440c4f 100644
--- a/connection_manager.cc
+++ b/connection_manager.cc
@@ -168,6 +168,9 @@
TEST_AND_RETURN_FALSE(GetDefaultServicePath(&default_service_path));
if (!default_service_path.IsValid())
return false;
+ // Shill uses the "/" service path to indicate that it is not connected.
+ if (default_service_path.value() == "/")
+ return false;
TEST_AND_RETURN_FALSE(
GetServicePathProperties(default_service_path, out_type, out_tethering));
return true;