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

Commit b173426b authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Make it possible to post closures to BTA message queue

Currently, every task executed on bta thread needs a separate event id,
structure holding its parameters, API method, and method that will be
executed in bta thread, which must accept generic tBTA_DM_MSG.

Because of that we end up with lots of boilerplate code, and possibility
to misinterpret bytes in tBTA_DM_MSG struct.

After this patch, we can post closures onto bta thread. Thanks to it we
don't need a struct to hold parameters, and the executed method can have
a meaningful parameters.

First experiments showed over 50% reduction in code size when rewriting
advertising code to new style, not to mention much better readability.

Bug: 30622771
Change-Id: I400839b920c04c67c893899969d07a02d9c1b2e6
parent 65915212
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment