From a80b64f2a0fa4c2ee792f4bb4c97120b33a5f8b8 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Fri, 15 Feb 2019 15:14:11 -0800 Subject: [PATCH] adbd: log when exiting due to root/unroot/tcpip/usb. Test: treehugger Change-Id: Ibfbe4d512c6e126f2e6d311867316f033a4c9ab7 --- adb/daemon/restart_service.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adb/daemon/restart_service.cpp b/adb/daemon/restart_service.cpp index 6803d93d7..16d262798 100644 --- a/adb/daemon/restart_service.cpp +++ b/adb/daemon/restart_service.cpp @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -37,6 +38,7 @@ void restart_root_service(unique_fd fd) { return; } + LOG(INFO) << "adbd restarting as root"; android::base::SetProperty("service.adb.root", "1"); WriteFdExactly(fd.get(), "restarting adbd as root\n"); } @@ -46,6 +48,8 @@ void restart_unroot_service(unique_fd fd) { WriteFdExactly(fd.get(), "adbd not running as root\n"); return; } + + LOG(INFO) << "adbd restarting as nonroot"; android::base::SetProperty("service.adb.root", "0"); WriteFdExactly(fd.get(), "restarting adbd as non root\n"); } @@ -56,11 +60,13 @@ void restart_tcp_service(unique_fd fd, int port) { return; } + LOG(INFO) << "adbd restarting in TCP mode (port = " << port << ")"; android::base::SetProperty("service.adb.tcp.port", android::base::StringPrintf("%d", port)); WriteFdFmt(fd.get(), "restarting in TCP mode port: %d\n", port); } void restart_usb_service(unique_fd fd) { + LOG(INFO) << "adbd restarting in USB mode"; android::base::SetProperty("service.adb.tcp.port", "0"); WriteFdExactly(fd.get(), "restarting in USB mode\n"); }