diff options
| author | Luke Huang <huangluke@google.com> | 2019-03-18 15:53:21 +0800 |
|---|---|---|
| committer | Luke Huang <huangluke@google.com> | 2019-04-24 18:31:45 +0800 |
| commit | cfd04b232b89f9c98d421ff1cc7343a57f6954d3 (patch) | |
| tree | 45ebc95486b0ae05dbf90cf60b66149f08236721 /server/main.cpp | |
| parent | 7720e4a569eacecce3d8c02ecdc023907e6c4c87 (diff) | |
| download | platform_system_netd-cfd04b232b89f9c98d421ff1cc7343a57f6954d3.tar.gz platform_system_netd-cfd04b232b89f9c98d421ff1cc7343a57f6954d3.tar.bz2 platform_system_netd-cfd04b232b89f9c98d421ff1cc7343a57f6954d3.zip | |
NDC migration to binder ver.
Make ndc communicating with netd via binder
Bug: 65862741
Test: built, flashed, booted
system/netd/tests/runtests.sh pass
manual test ndc commands
Change-Id: I9edfda61d8c3a4d7b404a428e7dbb4d08eff62a9
Diffstat (limited to 'server/main.cpp')
| -rw-r--r-- | server/main.cpp | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/server/main.cpp b/server/main.cpp index 45b968d0f..b783ce536 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -37,7 +37,6 @@ #include <binder/IServiceManager.h> #include <netdutils/Stopwatch.h> -#include "CommandListener.h" #include "Controllers.h" #include "FwmarkServer.h" #include "MDnsSdListener.h" @@ -54,7 +53,6 @@ using android::IPCThreadState; using android::status_t; using android::String16; -using android::net::CommandListener; using android::net::FwmarkServer; using android::net::gCtls; using android::net::gLog; @@ -105,10 +103,8 @@ int main() { // Before we do anything that could fork, mark CLOEXEC the UNIX sockets that we get from init. // FrameworkListener does this on initialization as well, but we only initialize these // components after having initialized other subsystems that can fork. - for (const auto& sock : { CommandListener::SOCKET_NAME, - DNSPROXYLISTENER_SOCKET_NAME, - FwmarkServer::SOCKET_NAME, - MDnsSdListener::SOCKET_NAME }) { + for (const auto& sock : + {DNSPROXYLISTENER_SOCKET_NAME, FwmarkServer::SOCKET_NAME, MDnsSdListener::SOCKET_NAME}) { setCloseOnExec(sock); } @@ -130,20 +126,6 @@ int main() { gCtls = new android::net::Controllers(); gCtls->init(); - // NetdNativeService must start before CommandListener. - // TODO: put NetdNativeService starting back after subsystems started - // after migrating CommandListener to NDC, aosp/929861. - Stopwatch subTime; - status_t ret; - if ((ret = NetdNativeService::start()) != android::OK) { - ALOGE("Unable to start NetdNativeService: %d", ret); - exit(1); - } - gLog.info("Registering NetdNativeService: %.1fms", subTime.getTimeAndReset()); - - CommandListener cl; - nm->setBroadcaster((SocketListener *) &cl); - if (nm->start()) { ALOGE("Unable to start NetlinkManager (%s)", strerror(errno)); exit(1); @@ -187,15 +169,13 @@ int main() { exit(1); } - /* - * Now that we're up, we can respond to commands. Starting the listener also tells - * NetworkManagementService that we are up and that our binder interface is ready. - */ - if (cl.startListener()) { - ALOGE("Unable to start CommandListener (%s)", strerror(errno)); + Stopwatch subTime; + status_t ret; + if ((ret = NetdNativeService::start()) != android::OK) { + ALOGE("Unable to start NetdNativeService: %d", ret); exit(1); } - gLog.info("Starting CommandListener: %.1fms", subTime.getTimeAndReset()); + gLog.info("Registering NetdNativeService: %.1fms", subTime.getTimeAndReset()); android::net::process::ScopedPidFile pidFile(PID_FILE_PATH); |
