diff options
author | San Mehat <san@google.com> | 2009-05-07 11:37:10 -0700 |
---|---|---|
committer | San Mehat <san@google.com> | 2009-05-09 10:33:18 -0700 |
commit | 1441e769b2767e212a3d905bee2fd3535b484ff2 (patch) | |
tree | 726f46620c2e9c4063ed9ecdd7e0cafcb6b6005e /nexus/NetworkManager.cpp | |
parent | b3779558dcfbe99f0b9c1ef796e3728edad25672 (diff) | |
download | system_core-1441e769b2767e212a3d905bee2fd3535b484ff2.zip system_core-1441e769b2767e212a3d905bee2fd3535b484ff2.tar.gz system_core-1441e769b2767e212a3d905bee2fd3535b484ff2.tar.bz2 |
nexus: Implement wifi scanner and fix a lot of bugs
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'nexus/NetworkManager.cpp')
-rw-r--r-- | nexus/NetworkManager.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/nexus/NetworkManager.cpp b/nexus/NetworkManager.cpp index 9c64945..3b823d1 100644 --- a/nexus/NetworkManager.cpp +++ b/nexus/NetworkManager.cpp @@ -21,36 +21,30 @@ #include <cutils/log.h> #include "NetworkManager.h" -#include "CommandListener.h" -#include "LoopController.h" -#include "VpnController.h" -#include "TiwlanWifiController.h" +NetworkManager *NetworkManager::sInstance = NULL; + +NetworkManager *NetworkManager::Instance() { + if (!sInstance) + sInstance = new NetworkManager(); + return sInstance; +} NetworkManager::NetworkManager() { - mListener = new CommandListener(this); - mFm = new FrameworkManager(mListener); + mBroadcaster = NULL; mControllers = new ControllerCollection(); } int NetworkManager::run() { - LOGD("NetworkManager::start()"); - - // XXX: Factory needed - addController(new LoopController()); - addController(new TiwlanWifiController("/system/lib/modules/wlan.ko", "wlan", "")); - addController(new VpnController()); - //addController(new GenericController("rmnet0")); - if (startControllers()) { LOGW("Unable to start all controllers (%s)", strerror(errno)); } - mFm->run(); return 0; } -void NetworkManager::addController(Controller *c) { +int NetworkManager::attachController(Controller *c) { mControllers->push_back(c); + return 0; } int NetworkManager::startControllers() { |