aboutsummaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-09-03 14:54:58 -0400
committerMike Lockwood <lockwood@android.com>2009-09-03 14:54:58 -0400
commitf56d1b5a76c6cb282a7689fc93f85de63bd205f6 (patch)
treefd1754e2ff6e835d415ad4cf2d531548afb348f4 /adb
parente991decf340e24203ed63f87d9313598cd09a46c (diff)
downloadsystem_core-f56d1b5a76c6cb282a7689fc93f85de63bd205f6.tar.gz
system_core-f56d1b5a76c6cb282a7689fc93f85de63bd205f6.tar.bz2
system_core-f56d1b5a76c6cb282a7689fc93f85de63bd205f6.zip
Revert "adb: "adb bugreport" now runs dumpstate via init rather than execing it in the shell."
This reverts commit be0045aafdbc2ec2ee448be86952082361f5d672. This change broke compatibility with previous versions of adbd, so I will be implementing this by modifying the bugreport command on the device instead.
Diffstat (limited to 'adb')
-rw-r--r--adb/commandline.c10
-rw-r--r--adb/services.c39
2 files changed, 9 insertions, 40 deletions
diff --git a/adb/commandline.c b/adb/commandline.c
index 66034521..411bb82a 100644
--- a/adb/commandline.c
+++ b/adb/commandline.c
@@ -929,7 +929,7 @@ top:
if(!strcmp(argv[0], "remount") || !strcmp(argv[0], "reboot")
|| !strcmp(argv[0], "tcpip") || !strcmp(argv[0], "usb")
- || !strcmp(argv[0], "root") || !strcmp(argv[0], "bugreport")) {
+ || !strcmp(argv[0], "root")) {
char command[100];
if (argc > 1)
snprintf(command, sizeof(command), "%s:%s", argv[0], argv[1]);
@@ -945,6 +945,14 @@ top:
return 1;
}
+ if(!strcmp(argv[0], "bugreport")) {
+ if (argc != 1) {
+ return 1;
+ }
+ do_cmd(ttype, serial, "shell", "dumpstate", "-", 0);
+ return 0;
+ }
+
/* adb_command() wrapper commands */
if(!strncmp(argv[0], "wait-for-", strlen("wait-for-"))) {
diff --git a/adb/services.c b/adb/services.c
index 447c11b5..2864ac97 100644
--- a/adb/services.c
+++ b/adb/services.c
@@ -188,43 +188,6 @@ void reboot_service(int fd, void *arg)
adb_close(fd);
}
-void bugreport_service(int fd, void *cookie)
-{
- char buffer[MAX_PAYLOAD];
- int i, s;
-
- /* start the dumpstate service */
- property_set("ctl.start", "dumpstate");
-
- /* socket will not be available until service starts */
- for (i = 0; i < 10; i++) {
- s = socket_local_client("dumpstate",
- ANDROID_SOCKET_NAMESPACE_RESERVED,
- SOCK_STREAM);
- if (s >= 0)
- break;
- /* try again in 1 second */
- sleep(1);
- }
-
- if (s < 0) {
- const char* failed = "Failed to connect to dumpstate service\n";
- writex(fd, failed, strlen(failed));
- adb_close(fd);
- return;
- }
-
- while (1) {
- int length = adb_read(s, buffer, sizeof(buffer));
- if (length <= 0)
- break;
- if (adb_write(fd, buffer, length) <= 0)
- break;
- }
- adb_close(s);
- adb_close(fd);
-}
-
#endif
#if 0
@@ -506,8 +469,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);
- } else if(!strncmp(name, "bugreport:", 10)) {
- ret = create_service_thread(bugreport_service, NULL);
#endif
#if 0
} else if(!strncmp(name, "echo:", 5)){