summaryrefslogtreecommitdiffstats
path: root/adb/adb.c
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2014-09-05 15:38:15 -0700
committerChih-Hung Hsieh <chh@google.com>2014-09-05 16:34:02 -0700
commitf787b381b6a304415030ed54bdba6ca482763e4c (patch)
tree72bfa96dd8082b86b4ab65eba49965c29667ed4d /adb/adb.c
parent35a76df583a07524bec5ccaae8082a00e0c06867 (diff)
downloadsystem_core-f787b381b6a304415030ed54bdba6ca482763e4c.zip
system_core-f787b381b6a304415030ed54bdba6ca482763e4c.tar.gz
system_core-f787b381b6a304415030ed54bdba6ca482763e4c.tar.bz2
Include ADB_HOST only code in #if ADB_HOST.
BUG: 17409892 Change-Id: Ic1199dd745191aba718fdb18343e87c0ccbe530b
Diffstat (limited to 'adb/adb.c')
-rw-r--r--adb/adb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/adb/adb.c b/adb/adb.c
index 10a1e0d..cf8e3c4 100644
--- a/adb/adb.c
+++ b/adb/adb.c
@@ -329,6 +329,7 @@ static void send_msg_with_header(int fd, const char* msg, size_t msglen) {
}
#endif
+#if ADB_HOST
static void send_msg_with_okay(int fd, const char* msg, size_t msglen) {
char header[9];
if (msglen > 0xffff)
@@ -337,6 +338,7 @@ static void send_msg_with_okay(int fd, const char* msg, size_t msglen) {
writex(fd, header, 8);
writex(fd, msg, msglen);
}
+#endif // ADB_HOST
static void send_connect(atransport *t)
{
@@ -414,6 +416,7 @@ void adb_auth_verified(atransport *t)
send_connect(t);
}
+#if ADB_HOST
static char *connection_state_name(atransport *t)
{
if (t == NULL) {
@@ -437,6 +440,7 @@ static char *connection_state_name(atransport *t)
return "unknown";
}
}
+#endif // ADB_HOST
/* qual_overwrite is used to overwrite a qualifier string. dst is a
* pointer to a char pointer. It is assumed that if *dst is non-NULL, it
@@ -1554,8 +1558,6 @@ int handle_forward_request(const char* service, transport_type ttype, char* seri
int handle_host_request(char *service, transport_type ttype, char* serial, int reply_fd, asocket *s)
{
- atransport *transport = NULL;
-
if(!strcmp(service, "kill")) {
fprintf(stderr,"adb server killed by remote request\n");
fflush(stdout);
@@ -1565,6 +1567,7 @@ int handle_host_request(char *service, transport_type ttype, char* serial, int r
}
#if ADB_HOST
+ atransport *transport = NULL;
// "transport:" is used for switching transport with a specified serial number
// "transport-usb:" is used for switching transport to the only USB transport
// "transport-local:" is used for switching transport to the only local transport