shill: Log cellular service destruction only if it actually happens.
Also, use Device::DropConnection instead of equivalent code sequence.
BUG=chromium-os:36054
TEST=unit tests; tested on device, inspected logs.
Change-Id: Ic72dad1ef81e57ae455f3ffd8fbe5bc2d87563b3
Reviewed-on: https://gerrit.chromium.org/gerrit/38023
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/cellular.cc b/cellular.cc
index 1e70021..ef4b15a 100644
--- a/cellular.cc
+++ b/cellular.cc
@@ -395,13 +395,13 @@
}
void Cellular::DestroyService() {
- LOG(INFO) << "Destroying service for device " << link_name();
- DestroyIPConfig();
+ DropConnection();
if (service_) {
+ LOG(INFO) << "Deregistering cellular service " << service_->friendly_name()
+ << " for device " << link_name();
manager()->DeregisterService(service_);
service_ = NULL;
}
- SelectService(NULL);
}
void Cellular::Connect(Error *error) {