Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 464ed18b authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Sergey Nikolaienkov
Browse files

Initial pass at socketpair() based CDM transport.

Based on design conversations with the team, it's more robust to
rely on a CDM companion service to provide a "streaming" interface
between two devices, instead of building our own message
fragmentation and reassembly logic.  (Most transports such as
Bluetooth RFCOMM will already be doing their own fragmentation, so
we don't need to duplicate that work.)

Additionally, this change uses socketpair() for the bidirectional
data transfer between the companion service and the system_server,
avoiding additional Binder transaction load while handling its own
chunking, at the expense of dedicating two threads to "shovel" data
in each direction.

This change attempts to implement the design in the most
straightforward way possible to reduce risk; there are several
opportunities to optimize the thread usage using tools like
MessageQueue.addOnFileDescriptorEventListener(), but those will
need to wait for a future iteration.

Also includes basic functionality tests that exercise a PING/PONG
command to verify many different edge cases; they're currently all
passing.

Bug: 237030169
Test: atest CompanionTests
Change-Id: I075128fa60379f47400345b211a07d9a32391155
parent d3c9bdd0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment