shill: cellular: Destroy cellular service before deregistering cellular device.
This ensures that when a Modem instance is destructed:
- The connection, if any, is dropped.
- The service, if any, is deregistered from the Manager.
- Circular references between the device and the service are eliminated.
- The service is destructed.
- The device is destructed.
Also, add extra logging at INFO level for infrequent but key events
such as Device construction and destruction.
BUG=chromium-os:31504
TEST=unit tests
Change-Id: I2e5a3d010339bfd32686a6a83a71b35b29edcbbc
Reviewed-on: https://gerrit.chromium.org/gerrit/26232
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/device.cc b/device.cc
index 995aeeb..a53e775 100644
--- a/device.cc
+++ b/device.cc
@@ -140,13 +140,13 @@
// flimflam::kScanningProperty: Registered in WiFi, Cellular
// flimflam::kScanIntervalProperty: Registered in WiFi, Cellular
-
- // TODO(pstew): Initialize Interface monitor, so we can detect new interfaces
- SLOG(Device, 2) << "Device " << link_name_ << " index " << interface_index;
+ LOG(INFO) << "Device created: " << link_name_
+ << " index " << interface_index_;
}
Device::~Device() {
- SLOG(Device, 2) << "Device " << link_name_ << " destroyed.";
+ LOG(INFO) << "Device destructed: " << link_name_
+ << " index " << interface_index_;
}
void Device::LinkEvent(unsigned flags, unsigned change) {