aboutsummaryrefslogtreecommitdiff
path: root/adb.h
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2017-05-03 22:37:10 -0700
committerJosh Gao <jmgao@google.com>2017-05-04 16:03:12 -0700
commit1e3bf7368051871e6cbf1430f436201d7b1e895b (patch)
treee31cc6a7a30963a7c1c0186668674c7dc3db1446 /adb.h
parenta7430f3affc6309ef7270fe4092bea956bfe261d (diff)
downloadadb-1e3bf7368051871e6cbf1430f436201d7b1e895b.tar.gz
adb: wait for devices to come up instead of sleeping for 3s.
Replace a hard-coded 3 second sleep with logic to wait until we've scanned USB devices once and they've all come online. Before: adb shell true 0.00s user 0.00s system 0% cpu 3.047 total After: adb shell true 0.00s user 0.00s system 9% cpu 0.041 total Bug: http://b/37869663 Test: `time adb shell true` after adb kill-server Change-Id: I251d42afb885908ed9d03167287594ea16650d3f
Diffstat (limited to 'adb.h')
-rw-r--r--adb.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/adb.h b/adb.h
index e3675d84..d6b2b818 100644
--- a/adb.h
+++ b/adb.h
@@ -228,4 +228,18 @@ void SendConnectOnHost(atransport* t);
void parse_banner(const std::string&, atransport* t);
+// On startup, the adb server needs to wait until all of the connected devices are ready.
+// To do this, we need to know when the scan has identified all of the potential new transports, and
+// when each transport becomes ready.
+// TODO: Do this for mDNS as well, instead of just USB?
+
+// We've found all of the transports we potentially care about.
+void adb_notify_device_scan_complete();
+
+// One or more transports have changed status, check to see if we're ready.
+void update_transport_status();
+
+// Wait until device scan has completed and every transport is ready, or a timeout elapses.
+void adb_wait_for_device_initialization();
+
#endif