Loading adb/Android.mk +1 −4 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ LOCAL_SRC_FILES := \ file_sync_client.c \ $(EXTRA_SRCS) \ $(USB_SRCS) \ utils.c \ usb_vendors.c LOCAL_C_INCLUDES += external/openssl/include Loading Loading @@ -116,8 +115,7 @@ LOCAL_SRC_FILES := \ framebuffer_service.c \ remount_service.c \ usb_linux_client.c \ log_service.c \ utils.c log_service.c LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE Loading Loading @@ -157,7 +155,6 @@ LOCAL_SRC_FILES := \ file_sync_client.c \ get_my_path_linux.c \ usb_linux.c \ utils.c \ usb_vendors.c \ fdevent.c Loading adb/SERVICES.TXT +0 −21 Original line number Diff line number Diff line Loading @@ -225,27 +225,6 @@ framebuffer: If the adbd daemon doesn't have sufficient privileges to open the framebuffer device, the connection is simply closed immediately. dns:<server-name> This service is an exception because it only runs within the ADB server. It is used to implement USB networking, i.e. to provide a network connection to the device through the host machine (note: this is the exact opposite of network tethering). It is used to perform a gethostbyname(<address>) on the host and return the corresponding IP address as a 4-byte string. recover:<size> This service is used to upload a recovery image to the device. <size> must be a number corresponding to the size of the file. The service works by: - creating a file named /tmp/update - reading 'size' bytes from the client and writing them to /tmp/update - when everything is read successfully, create a file named /tmp/update.start This service can only work when the device is in recovery mode. Otherwise, the /tmp directory doesn't exist and the connection will be closed immediately. jdwp:<pid> Connects to the JDWP thread running in the VM of process <pid>. Loading adb/adb.h +1 −4 Original line number Diff line number Diff line Loading @@ -128,9 +128,6 @@ struct asocket { */ void (*close)(asocket *s); /* socket-type-specific extradata */ void *extra; /* A socket is bound to atransport */ atransport *transport; }; Loading adb/mutex_list.h +0 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ #ifndef ADB_MUTEX #error ADB_MUTEX not defined when including this file #endif ADB_MUTEX(dns_lock) ADB_MUTEX(socket_list_lock) ADB_MUTEX(transport_lock) #if ADB_HOST Loading adb/services.c +2 −101 Original line number Diff line number Diff line Loading @@ -53,59 +53,7 @@ void *service_bootstrap_func(void *x) return 0; } #if ADB_HOST ADB_MUTEX_DEFINE( dns_lock ); static void dns_service(int fd, void *cookie) { char *hostname = cookie; struct hostent *hp; unsigned zero = 0; adb_mutex_lock(&dns_lock); hp = gethostbyname(hostname); free(cookie); if(hp == 0) { writex(fd, &zero, 4); } else { writex(fd, hp->h_addr, 4); } adb_mutex_unlock(&dns_lock); adb_close(fd); } #else extern int recovery_mode; static void recover_service(int s, void *cookie) { unsigned char buf[4096]; unsigned count = (unsigned) cookie; int fd; fd = adb_creat("/tmp/update", 0644); if(fd < 0) { adb_close(s); return; } while(count > 0) { unsigned xfer = (count > 4096) ? 4096 : count; if(readx(s, buf, xfer)) break; if(writex(fd, buf, xfer)) break; count -= xfer; } if(count == 0) { writex(s, "OKAY", 4); } else { writex(s, "FAIL", 4); } adb_close(fd); adb_close(s); fd = adb_creat("/tmp/update.begin", 0644); adb_close(fd); } #if !ADB_HOST void restart_root_service(int fd, void *cookie) { Loading Loading @@ -202,40 +150,6 @@ cleanup: #endif #if 0 static void echo_service(int fd, void *cookie) { char buf[4096]; int r; char *p; int c; for(;;) { r = adb_read(fd, buf, 4096); if(r == 0) goto done; if(r < 0) { if(errno == EINTR) continue; else goto done; } c = r; p = buf; while(c > 0) { r = write(fd, p, c); if(r > 0) { c -= r; p += r; continue; } if((r < 0) && (errno == EINTR)) continue; goto done; } } done: close(fd); } #endif static int create_service_thread(void (*func)(int, void *), void *cookie) { stinfo *sti; Loading Loading @@ -422,9 +336,7 @@ int service_to_fd(const char *name) disable_tcp_nagle(ret); } else { #if ADB_HOST adb_mutex_lock(&dns_lock); ret = socket_network_client(name + 1, port, SOCK_STREAM); adb_mutex_unlock(&dns_lock); #else return -1; #endif Loading @@ -443,18 +355,11 @@ int service_to_fd(const char *name) ret = socket_local_client(name + 16, ANDROID_SOCKET_NAMESPACE_FILESYSTEM, SOCK_STREAM); #endif #if ADB_HOST } else if(!strncmp("dns:", name, 4)){ char *n = strdup(name + 4); if(n == 0) return -1; ret = create_service_thread(dns_service, n); #else /* !ADB_HOST */ #if !ADB_HOST } else if(!strncmp("dev:", name, 4)) { ret = unix_open(name + 4, O_RDWR); } else if(!strncmp(name, "framebuffer:", 12)) { ret = create_service_thread(framebuffer_service, 0); } else if(recovery_mode && !strncmp(name, "recover:", 8)) { ret = create_service_thread(recover_service, (void*) atoi(name + 8)); } else if (!strncmp(name, "jdwp:", 5)) { ret = create_jdwp_connection_fd(atoi(name+5)); } else if (!strncmp(name, "log:", 4)) { Loading Loading @@ -489,10 +394,6 @@ int service_to_fd(const char *name) ret = create_service_thread(restart_tcp_service, (void *)port); } else if(!strncmp(name, "usb:", 4)) { ret = create_service_thread(restart_usb_service, NULL); #endif #if 0 } else if(!strncmp(name, "echo:", 5)){ ret = create_service_thread(echo_service, 0); #endif } if (ret >= 0) { Loading Loading
adb/Android.mk +1 −4 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ LOCAL_SRC_FILES := \ file_sync_client.c \ $(EXTRA_SRCS) \ $(USB_SRCS) \ utils.c \ usb_vendors.c LOCAL_C_INCLUDES += external/openssl/include Loading Loading @@ -116,8 +115,7 @@ LOCAL_SRC_FILES := \ framebuffer_service.c \ remount_service.c \ usb_linux_client.c \ log_service.c \ utils.c log_service.c LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE Loading Loading @@ -157,7 +155,6 @@ LOCAL_SRC_FILES := \ file_sync_client.c \ get_my_path_linux.c \ usb_linux.c \ utils.c \ usb_vendors.c \ fdevent.c Loading
adb/SERVICES.TXT +0 −21 Original line number Diff line number Diff line Loading @@ -225,27 +225,6 @@ framebuffer: If the adbd daemon doesn't have sufficient privileges to open the framebuffer device, the connection is simply closed immediately. dns:<server-name> This service is an exception because it only runs within the ADB server. It is used to implement USB networking, i.e. to provide a network connection to the device through the host machine (note: this is the exact opposite of network tethering). It is used to perform a gethostbyname(<address>) on the host and return the corresponding IP address as a 4-byte string. recover:<size> This service is used to upload a recovery image to the device. <size> must be a number corresponding to the size of the file. The service works by: - creating a file named /tmp/update - reading 'size' bytes from the client and writing them to /tmp/update - when everything is read successfully, create a file named /tmp/update.start This service can only work when the device is in recovery mode. Otherwise, the /tmp directory doesn't exist and the connection will be closed immediately. jdwp:<pid> Connects to the JDWP thread running in the VM of process <pid>. Loading
adb/adb.h +1 −4 Original line number Diff line number Diff line Loading @@ -128,9 +128,6 @@ struct asocket { */ void (*close)(asocket *s); /* socket-type-specific extradata */ void *extra; /* A socket is bound to atransport */ atransport *transport; }; Loading
adb/mutex_list.h +0 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ #ifndef ADB_MUTEX #error ADB_MUTEX not defined when including this file #endif ADB_MUTEX(dns_lock) ADB_MUTEX(socket_list_lock) ADB_MUTEX(transport_lock) #if ADB_HOST Loading
adb/services.c +2 −101 Original line number Diff line number Diff line Loading @@ -53,59 +53,7 @@ void *service_bootstrap_func(void *x) return 0; } #if ADB_HOST ADB_MUTEX_DEFINE( dns_lock ); static void dns_service(int fd, void *cookie) { char *hostname = cookie; struct hostent *hp; unsigned zero = 0; adb_mutex_lock(&dns_lock); hp = gethostbyname(hostname); free(cookie); if(hp == 0) { writex(fd, &zero, 4); } else { writex(fd, hp->h_addr, 4); } adb_mutex_unlock(&dns_lock); adb_close(fd); } #else extern int recovery_mode; static void recover_service(int s, void *cookie) { unsigned char buf[4096]; unsigned count = (unsigned) cookie; int fd; fd = adb_creat("/tmp/update", 0644); if(fd < 0) { adb_close(s); return; } while(count > 0) { unsigned xfer = (count > 4096) ? 4096 : count; if(readx(s, buf, xfer)) break; if(writex(fd, buf, xfer)) break; count -= xfer; } if(count == 0) { writex(s, "OKAY", 4); } else { writex(s, "FAIL", 4); } adb_close(fd); adb_close(s); fd = adb_creat("/tmp/update.begin", 0644); adb_close(fd); } #if !ADB_HOST void restart_root_service(int fd, void *cookie) { Loading Loading @@ -202,40 +150,6 @@ cleanup: #endif #if 0 static void echo_service(int fd, void *cookie) { char buf[4096]; int r; char *p; int c; for(;;) { r = adb_read(fd, buf, 4096); if(r == 0) goto done; if(r < 0) { if(errno == EINTR) continue; else goto done; } c = r; p = buf; while(c > 0) { r = write(fd, p, c); if(r > 0) { c -= r; p += r; continue; } if((r < 0) && (errno == EINTR)) continue; goto done; } } done: close(fd); } #endif static int create_service_thread(void (*func)(int, void *), void *cookie) { stinfo *sti; Loading Loading @@ -422,9 +336,7 @@ int service_to_fd(const char *name) disable_tcp_nagle(ret); } else { #if ADB_HOST adb_mutex_lock(&dns_lock); ret = socket_network_client(name + 1, port, SOCK_STREAM); adb_mutex_unlock(&dns_lock); #else return -1; #endif Loading @@ -443,18 +355,11 @@ int service_to_fd(const char *name) ret = socket_local_client(name + 16, ANDROID_SOCKET_NAMESPACE_FILESYSTEM, SOCK_STREAM); #endif #if ADB_HOST } else if(!strncmp("dns:", name, 4)){ char *n = strdup(name + 4); if(n == 0) return -1; ret = create_service_thread(dns_service, n); #else /* !ADB_HOST */ #if !ADB_HOST } else if(!strncmp("dev:", name, 4)) { ret = unix_open(name + 4, O_RDWR); } else if(!strncmp(name, "framebuffer:", 12)) { ret = create_service_thread(framebuffer_service, 0); } else if(recovery_mode && !strncmp(name, "recover:", 8)) { ret = create_service_thread(recover_service, (void*) atoi(name + 8)); } else if (!strncmp(name, "jdwp:", 5)) { ret = create_jdwp_connection_fd(atoi(name+5)); } else if (!strncmp(name, "log:", 4)) { Loading Loading @@ -489,10 +394,6 @@ int service_to_fd(const char *name) ret = create_service_thread(restart_tcp_service, (void *)port); } else if(!strncmp(name, "usb:", 4)) { ret = create_service_thread(restart_usb_service, NULL); #endif #if 0 } else if(!strncmp(name, "echo:", 5)){ ret = create_service_thread(echo_service, 0); #endif } if (ret >= 0) { Loading