Tango can provide a built-in API to wait for the acknowledgement, rather than requiring the developer to use AdbScrcpyClient#deviceMessageStream
How should the API change?
Move ScrcpyDeviceMessageDeserializeStream into ScrcpyOptions, allowing the options class to handle device messages according to their versions.
Add setClipboard to ScrcpyOptions, allowing options classes to have complete control.
Add a new type parameter TDeviceMessages to ScrcpyOptions, allowing ScrcpyOptions (and AdbScrcpyClient#deviceMessageStream to have different types for each version.
(Optional) Other information
When I was adding virtual displays to Scrcpy, I sent a device message to the client with the newly created display ID, so the client can launch apps (and do other things) on the display. Except, the current architecture doesn't allow me to add such device message into AdbScrcpyClient#deviceMessageStream, so I ended printing the display ID into stdout. This change can also fulfill this requirement.
Pre-issue checklist
How can Tango be improved?
Added in Scrcpy v1.21, the server sends an acknowledge packet after successfully setting device clipboard.
https://docs.tangoapp.dev/scrcpy/versions/#v121-23
Tango can provide a built-in API to wait for the acknowledgement, rather than requiring the developer to use
AdbScrcpyClient#deviceMessageStream
How should the API change?
ScrcpyDeviceMessageDeserializeStream
intoScrcpyOptions
, allowing the options class to handle device messages according to their versions.setClipboard
toScrcpyOptions
, allowing options classes to have complete control.TDeviceMessages
toScrcpyOptions
, allowingScrcpyOptions
(andAdbScrcpyClient#deviceMessageStream
to have different types for each version.(Optional) Other information
When I was adding virtual displays to Scrcpy, I sent a device message to the client with the newly created display ID, so the client can launch apps (and do other things) on the display. Except, the current architecture doesn't allow me to add such device message into
AdbScrcpyClient#deviceMessageStream
, so I ended printing the display ID into stdout. This change can also fulfill this requirement.