diff options
Diffstat (limited to '')
-rw-r--r-- | src/OSSupport/NetworkSingleton.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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 <sys/system_properties.h> +#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); |