merge in ics-release history after reset to master
diff --git a/adb/usb_vendors.c b/adb/usb_vendors.c
index 141b32a..e0c6a47 100644
--- a/adb/usb_vendors.c
+++ b/adb/usb_vendors.c
@@ -97,8 +97,10 @@
#define VENDOR_ID_COMPAL 0x1219
// T & A Mobile Phones' USB Vendor ID
#define VENDOR_ID_T_AND_A 0x1BBB
+// LenovoMobile's USB Vendor ID
+#define VENDOR_ID_LENOVOMOBILE 0x2006
// Lenovo's USB Vendor ID
-#define VENDOR_ID_LENOVO 0x2006
+#define VENDOR_ID_LENOVO 0x17EF
// Vizio's USB Vendor ID
#define VENDOR_ID_VIZIO 0xE040
@@ -136,6 +138,7 @@
VENDOR_ID_IRIVER,
VENDOR_ID_COMPAL,
VENDOR_ID_T_AND_A,
+ VENDOR_ID_LENOVOMOBILE,
VENDOR_ID_LENOVO,
VENDOR_ID_VIZIO,
};
diff --git a/libnetutils/dhcp_utils.c b/libnetutils/dhcp_utils.c
index 5991ea8..3ab5d1b 100644
--- a/libnetutils/dhcp_utils.c
+++ b/libnetutils/dhcp_utils.c
@@ -33,6 +33,8 @@
/* when polling for property values */
static const char DAEMON_NAME_RENEW[] = "iprenew";
static char errmsg[100];
+/* interface suffix on dhcpcd */
+#define MAX_DAEMON_SUFFIX 25
/*
* Wait for a system property to be assigned a specified value.
@@ -131,6 +133,15 @@
return inet_ntoa(in_addr);
}
+void get_daemon_suffix(const char *interface, char *daemon_suffix) {
+ /* Use p2p suffix for any p2p interface. */
+ if (strncmp(interface, "p2p",3) == 0) {
+ sprintf(daemon_suffix, "p2p");
+ } else {
+ snprintf(daemon_suffix, MAX_DAEMON_SUFFIX, "%s", interface);
+ }
+}
+
/*
* Start the dhcp client daemon, and wait for it to finish
* configuring the interface.
@@ -150,6 +161,9 @@
char daemon_cmd[PROPERTY_VALUE_MAX * 2];
const char *ctrl_prop = "ctl.start";
const char *desired_status = "running";
+ char daemon_suffix[MAX_DAEMON_SUFFIX];
+
+ get_daemon_suffix(interface, daemon_suffix);
snprintf(result_prop_name, sizeof(result_prop_name), "%s.%s.result",
DHCP_PROP_NAME_PREFIX,
@@ -157,17 +171,17 @@
snprintf(daemon_prop_name, sizeof(daemon_prop_name), "%s_%s",
DAEMON_PROP_NAME,
- interface);
+ daemon_suffix);
/* Erase any previous setting of the dhcp result property */
property_set(result_prop_name, "");
/* Start the daemon and wait until it's ready */
if (property_get(HOSTNAME_PROP_NAME, prop_value, NULL) && (prop_value[0] != '\0'))
- snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:-h %s %s", DAEMON_NAME, interface,
+ snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:-h %s %s", DAEMON_NAME, daemon_suffix,
prop_value, interface);
else
- snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:%s", DAEMON_NAME, interface, interface);
+ snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:%s", DAEMON_NAME, daemon_suffix, interface);
memset(prop_value, '\0', PROPERTY_VALUE_MAX);
property_set(ctrl_prop, daemon_cmd);
if (wait_for_property(daemon_prop_name, desired_status, 10) < 0) {
@@ -217,15 +231,19 @@
const char *ctrl_prop = "ctl.stop";
const char *desired_status = "stopped";
+ char daemon_suffix[MAX_DAEMON_SUFFIX];
+
+ get_daemon_suffix(interface, daemon_suffix);
+
snprintf(result_prop_name, sizeof(result_prop_name), "%s.%s.result",
DHCP_PROP_NAME_PREFIX,
interface);
snprintf(daemon_prop_name, sizeof(daemon_prop_name), "%s_%s",
DAEMON_PROP_NAME,
- interface);
+ daemon_suffix);
- snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s", DAEMON_NAME, interface);
+ snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s", DAEMON_NAME, daemon_suffix);
/* Stop the daemon and wait until it's reported to be stopped */
property_set(ctrl_prop, daemon_cmd);
@@ -246,11 +264,15 @@
const char *ctrl_prop = "ctl.stop";
const char *desired_status = "stopped";
+ char daemon_suffix[MAX_DAEMON_SUFFIX];
+
+ get_daemon_suffix(interface, daemon_suffix);
+
snprintf(daemon_prop_name, sizeof(daemon_prop_name), "%s_%s",
DAEMON_PROP_NAME,
- interface);
+ daemon_suffix);
- snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s", DAEMON_NAME, interface);
+ snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s", DAEMON_NAME, daemon_suffix);
/* Stop the daemon and wait until it's reported to be stopped */
property_set(ctrl_prop, daemon_cmd);
@@ -282,6 +304,10 @@
char daemon_cmd[PROPERTY_VALUE_MAX * 2];
const char *ctrl_prop = "ctl.start";
+ char daemon_suffix[MAX_DAEMON_SUFFIX];
+
+ get_daemon_suffix(interface, daemon_suffix);
+
snprintf(result_prop_name, sizeof(result_prop_name), "%s.%s.result",
DHCP_PROP_NAME_PREFIX,
interface);
@@ -290,7 +316,8 @@
property_set(result_prop_name, "");
/* Start the renew daemon and wait until it's ready */
- snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:%s", DAEMON_NAME_RENEW, interface, interface);
+ snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:%s", DAEMON_NAME_RENEW,
+ daemon_suffix, interface);
memset(prop_value, '\0', PROPERTY_VALUE_MAX);
property_set(ctrl_prop, daemon_cmd);