adbd: check auth id.
When multiple auth requests come in (e.g. if someone connects over TCP
and USB, or if we send a USB request, and then kill adb and try again),
we need to disambiguate.
Bug: http://b/159061108
Test: manual
Change-Id: I0768dc3c1830456cb8cbd4395c23ef8f193cc420
diff --git a/adb/transport.h b/adb/transport.h
index 5bc1b5c..26d804b 100644
--- a/adb/transport.h
+++ b/adb/transport.h
@@ -27,6 +27,7 @@
#include <list>
#include <memory>
#include <mutex>
+#include <optional>
#include <string>
#include <string_view>
#include <thread>
@@ -306,7 +307,7 @@
#if !ADB_HOST
// Used to provide the key to the framework.
std::string auth_key;
- uint64_t auth_id;
+ std::optional<uint64_t> auth_id;
#endif
bool IsTcpDevice() const { return type == kTransportLocal; }