From 8c6d0b51c719e1817e308375d129b17ede3b82fc Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 7 Nov 2016 22:15:07 +0000 Subject: Use CMake's Android generators to crosscompile --- src/OSSupport/NetworkSingleton.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/OSSupport/NetworkSingleton.cpp') diff --git a/src/OSSupport/NetworkSingleton.cpp b/src/OSSupport/NetworkSingleton.cpp index dcf17bccb..3a8dbbdc7 100644 --- a/src/OSSupport/NetworkSingleton.cpp +++ b/src/OSSupport/NetworkSingleton.cpp @@ -13,6 +13,11 @@ #include "IPLookup.h" #include "HostnameLookup.h" +#ifdef ANDROID + // For DNS server retrieval + #include +#endif + @@ -89,6 +94,16 @@ void cNetworkSingleton::Initialise(void) abort(); } + #ifdef ANDROID + char PropertyBuffer[PROP_VALUE_MAX]; + + __system_property_get("net.dns1", PropertyBuffer); + evdns_base_nameserver_ip_add(m_DNSBase, PropertyBuffer); + + __system_property_get("net.dns2", PropertyBuffer); + evdns_base_nameserver_ip_add(m_DNSBase, PropertyBuffer); + #endif + // Create the event loop thread: m_HasTerminated = false; m_EventLoopThread = std::thread(RunEventLoop, this); -- cgit v1.2.3