adb: redirect stdout/stderr before initializing usb.
Avoid printing USB logging to the console.
Test: None
Change-Id: Ib8ad0ad6c559689d0f8feec2e66b42380edd26fb
diff --git a/adb/client/main.cpp b/adb/client/main.cpp
index bd9ad01..62798cd 100644
--- a/adb/client/main.cpp
+++ b/adb/client/main.cpp
@@ -125,6 +125,11 @@
});
#endif
+ if (is_daemon) {
+ close_stdin();
+ setup_daemon_logging();
+ }
+
android::base::at_quick_exit(adb_server_cleanup);
init_transport_registration();
@@ -148,11 +153,6 @@
std::this_thread::sleep_for(100ms);
}
- if (is_daemon) {
- close_stdin();
- setup_daemon_logging();
- }
-
adb_auth_init();
if (is_daemon) {