From 7941cf87f624e7747b5bb868a27904c7a3be0ca4 Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Fri, 16 Mar 2012 14:44:17 -0700 Subject: [PATCH] Revert "Reimplement the "adb root" command to more closely match its previous behavior" This reverts commit 535164e9d9649a83d4d63829f3389f2bea339fe1. --- adb/services.c | 6 ++++-- rootdir/init.rc | 12 ------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/adb/services.c b/adb/services.c index 6940be800..6bbd6f882 100644 --- a/adb/services.c +++ b/adb/services.c @@ -125,12 +125,14 @@ void restart_root_service(int fd, void *cookie) return; } + property_set("service.adb.root", "1"); snprintf(buf, sizeof(buf), "restarting adbd as root\n"); writex(fd, buf, strlen(buf)); adb_close(fd); - // This will cause a property trigger in init.rc to restart us - property_set("service.adb.root", "1"); + // quit, and init will restart us as root + sleep(1); + exit(1); } } diff --git a/rootdir/init.rc b/rootdir/init.rc index 438ac8307..7775cdc12 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -376,18 +376,6 @@ service adbd /sbin/adbd on property:ro.kernel.qemu=1 start adbd -# This property trigger has added to imitiate the previous behavior of "adb root". -# The adb gadget driver used to reset the USB bus when the adbd daemon exited, -# and the host side adb relied on this behavior to force it to reconnect with the -# new adbd instance after init relaunches it. So now we force the USB bus to reset -# here when adbd sets the service.adb.root property to 1. We also restart adbd here -# rather than waiting for init to notice its death and restarting it so the timing -# of USB resetting and adb restarting more closely matches the previous behavior. -on property:service.adb.root=1 - write /sys/class/android_usb/android0/enable 0 - restart adbd - write /sys/class/android_usb/android0/enable 1 - service servicemanager /system/bin/servicemanager class core user system