Use dlopen() and dlsym() for resolver functions

This is a workaround to allow us to use libnetd_resolv.so from
the resolver APEX before b/120661824 is fixed.

Test: builds, boots
Test: system/netd/tests/runtests.sh
Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest
Change-Id: I752ae248bb59545b0a4fbc1a7b8c9bcd697a31d4
diff --git a/server/main.cpp b/server/main.cpp
index a14cd8b..b9ff33f 100644
--- a/server/main.cpp
+++ b/server/main.cpp
@@ -48,6 +48,8 @@
 #include "Process.h"
 #include "Stopwatch.h"
 
+#include "netd_resolv/resolv_stub.h"
+
 using android::status_t;
 using android::sp;
 using android::IPCThreadState;
@@ -85,6 +87,9 @@
         setCloseOnExec(sock);
     }
 
+    // Before we start any threads, populate the resolver stub pointers.
+    resolv_stub_init();
+
     NetlinkManager *nm = NetlinkManager::Instance();
     if (nm == nullptr) {
         ALOGE("Unable to create NetlinkManager");