shill: vpn: Destroy Unload()ed VPN services
BUG=chromium-os:28481
TEST=New unit test.
Change-Id: I222441d3ff5cbc7d97d97f7fdd2917eee5921721
Reviewed-on: https://gerrit.chromium.org/gerrit/19143
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/wifi_service.cc b/wifi_service.cc
index 2faa452..aa59bf6 100644
--- a/wifi_service.cc
+++ b/wifi_service.cc
@@ -307,7 +307,7 @@
return true;
}
-void WiFiService::Unload() {
+bool WiFiService::Unload() {
Service::Unload();
hidden_ssid_ = false;
passphrase_ = "";
@@ -323,6 +323,7 @@
// for a service changes. crosbug.com/25670
wifi_->ClearCachedCredentials();
}
+ return !IsVisible();
}
bool WiFiService::IsSecurityMatch(const string &security) const {