Doesn't start adb usb server if name is empty.
Earlier I had tried to disable adb usb by giving an empty string for the
name, but that wasn't enough. Trying to start a second cuttlefish
instance actually tries to use the same name (the empty string) and
fails.
Bug: 78595418
Test: copy launch_cvd to gce, start two instances with adb usb disabled.
Change-Id: I479c0e5ce8284ae7c34d9328ab16ae682bc7c517
(cherry picked from commit 3b8324f20c159dbeabbbd213838e5ed9ca50fef5)
diff --git a/host/libs/vadb/virtual_adb_server.cpp b/host/libs/vadb/virtual_adb_server.cpp
index 63283e1..cf87940 100644
--- a/host/libs/vadb/virtual_adb_server.cpp
+++ b/host/libs/vadb/virtual_adb_server.cpp
@@ -19,6 +19,10 @@
namespace vadb {
bool VirtualADBServer::Init() {
+ if (name_.empty()) {
+ LOG(INFO) << "name_ empty, not starting server socket";
+ return true;
+ }
LOG(INFO) << "Starting server socket: " << name_;
server_ =