ya-webadb icon indicating copy to clipboard operation
ya-webadb copied to clipboard

Delayed ack

Open yume-chan opened this issue 1 year ago • 2 comments

This PR implements the delayed ack feature of ADB. It should be available in Android 14.

Upstream changes: https://android-review.googlesource.com/q/I6498d18e5ab4d866a81bf4d5c3d65cebb579c059

Traditionally, ADB protocol waits for an acknowledge packet before sending another data packet. By allowing sending data without acknowledge packets, this change can dramatically improve the throughput, especially in high latency situations like ADB over WiFi.

The initial payload size is not configurable in official ADB, but other values should still work.

Breaking Changes

  1. Converted parameter list of Adb.authenticate and Adb.constructor into objects. This allows more options to be added.
  2. socket.writable.getWriter().write() no longer waits for ack packet (even if delayed ack is not enabled). In fact, it even doesn't wait until the data has been passed to the backend. Instead, the next write will first wait for ack packet (if needed), then send the given data. For reusing buffer, using the consumable mechanism to wait for the backend to consume the data.

yume-chan avatar Feb 26 '23 16:02 yume-chan