Adding Android Binder Bridge (abb) utility launched from adbd.
Once launched, abb will listen for incoming Binder cli requests.
Executing in-process provides 6x latency improvement (125ms vs 25ms on
PixelXL) for commands like 'package path'
Intended usage by Android Studio for fast deployment and patching of APKs.
Test: manual
BUG: 111621042
Change-Id: Ica84eb2ec9628efa441ecd627b119f3361feaf9f
diff --git a/adb_io.h b/adb_io.h
index aa550af..2ccaa32 100644
--- a/adb_io.h
+++ b/adb_io.h
@@ -21,6 +21,8 @@
#include <string>
+#include "adb_unique_fd.h"
+
// Sends the protocol "OKAY" message.
bool SendOkay(int fd);
@@ -73,4 +75,12 @@
// Same as above, but formats the string to send.
bool WriteFdFmt(int fd, const char* fmt, ...) __attribute__((__format__(__printf__, 2, 3)));
+#if !ADB_HOST
+// Sends an FD via Unix domain socket.
+bool SendFileDescriptor(int socket_fd, int fd);
+
+// Receives an FD via Unix domain socket.
+bool ReceiveFileDescriptor(int socket_fd, unique_fd* fd, std::string* error);
+#endif
+
#endif /* ADB_IO_H */