shill: have Service check if a service is connected/connecting
before executing an AutoConnect request.
This avoids a spurious warning in the log file, if manager
autoconnects to an already connected Cellular service.
No effect on Ethernet services, because Ethernet's connect is
a no-op. No effect on WiFi services, because they override
Service::AutoConnect.
BUG=None
TEST=new unit test
Change-Id: If9e6c18735a5fb8a0d9baa1602c392ce7ec6e932
Reviewed-on: https://gerrit.chromium.org/gerrit/14097
Reviewed-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/wifi_service.cc b/wifi_service.cc
index a676fa2..2100bc4 100644
--- a/wifi_service.cc
+++ b/wifi_service.cc
@@ -152,8 +152,8 @@
// (Needed because hidden Services may remain registered with
// Manager even without visible Endpoints.)
&& HasEndpoints()
- // Do not preempt other connections (whether pending, or
- // connected).
+ // Do not preempt an existing connection (whether pending, or
+ // connected, and whether to this service, or another).
&& wifi_->IsIdle();
}