diff options
| author | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-15 14:40:51 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-15 14:40:51 -0700 |
| commit | 43c16197b2a6da3a3125b4a4a9fa6b70f447043e (patch) | |
| tree | 4f6edca731c7949deb59b76682eea7ffaa85b3f6 /nexus/VpnController.cpp | |
| parent | 2d0a6ca27c6f75eb0ec881fe4ad0b4f478d941c0 (diff) | |
| parent | 3aff2d1de59972684bf2ab798351be5544158239 (diff) | |
| download | system_core-43c16197b2a6da3a3125b4a4a9fa6b70f447043e.zip system_core-43c16197b2a6da3a3125b4a4a9fa6b70f447043e.tar.gz system_core-43c16197b2a6da3a3125b4a4a9fa6b70f447043e.tar.bz2 | |
Merge change 4228 into donut
* changes:
Nexus: Clean up supplicant events, protocol, and continue plumbing
Diffstat (limited to 'nexus/VpnController.cpp')
| -rw-r--r-- | nexus/VpnController.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/nexus/VpnController.cpp b/nexus/VpnController.cpp index 1246703..add4dc3 100644 --- a/nexus/VpnController.cpp +++ b/nexus/VpnController.cpp @@ -25,18 +25,19 @@ #include "PropertyManager.h" #include "VpnController.h" -VpnController::VpnController(PropertyManager *propmngr) : - Controller("VPN", propmngr) { +VpnController::VpnController(PropertyManager *propmngr, + IControllerHandler *handlers) : + Controller("VPN", propmngr, handlers) { mEnabled = false; - propmngr->registerProperty("vpn.enabled", this); - propmngr->registerProperty("vpn.gateway", this); } int VpnController::start() { + mPropMngr->registerProperty("vpn.enabled", this); return 0; } int VpnController::stop() { + mPropMngr->unregisterProperty("vpn.enabled"); return 0; } @@ -49,8 +50,13 @@ int VpnController::set(const char *name, const char *value) { return 0; rc = (en ? enable() : disable()); - if (!rc) + if (!rc) { mEnabled = en; + if (en) + mPropMngr->unregisterProperty("vpn.gateway"); + else + mPropMngr->unregisterProperty("vpn.gateway"); + } return rc; } if (!strcmp(name, "vpn.gateway")) { if (!inet_aton(value, &mVpnGateway)) { |
