#include "misc.h"
#include <getopt.h>
#include <sys/socket.h>
+#include <cutils/properties.h>
#include <cutils/sockets.h>
-#include <sys/system_properties.h>
#include <termios.h>
#include <qemu_pipe.h>
#include <sys/wait.h>
static bool hasWifiCapability()
{
char propValue[PROP_VALUE_MAX];
- return __system_property_get("ro.kernel.qemu.wifi", propValue) != 0 &&
+ return property_get("ro.kernel.qemu.wifi", propValue, "") > 0 &&
strcmp("1", propValue) == 0;
}
snprintf(propName, sizeof propName, "net.eth0.dns%d", nn);
/* Ignore if undefined */
- if (__system_property_get(propName, propValue) == 0) {
+ if (property_get(propName, propValue, "") <= 0) {
continue;
}
/* There is only one gateway in the emulator. If WiFi is
* configured the interface visible to RIL will be behind a NAT
* where the gateway is different. */
- responses[i].gateways = hasWifi ? "192.168.200.1" : "10.0.2.2";
+ if (hasWifi) {
+ responses[i].gateways = "192.168.200.1";
+ } else if (property_get("net.eth0.gw", propValue, "") > 0) {
+ responses[i].gateways = propValue;
+ } else {
+ responses[i].gateways = "";
+ }
responses[i].mtu = DEFAULT_MTU;
}
else {