mer-hybris / libgbinder

GLib-style interface to binder
BSD 3-Clause "New" or "Revised" License
51 stars 40 forks source link

Make protocol selectable at runtime #93

Closed aleasto closed 2 years ago

aleasto commented 2 years ago

In waydroid we spawn binder services from the host to interact with the android container. Having the binder protocol as a system configuration makes it impossible to upgrade the android version without also updating the host configuration. We don't want these necessarily coupled.

Make the protocol selectable as a string so we can dynamically choose how to talk to the android container based on its android version.

aleasto commented 2 years ago

Mh I probably need to split the service manager protocol vs the rpc protocol looking at https://github.com/mer-hybris/libgbinder/pull/83

monich commented 2 years ago

You should update unit tests too:

unit_servicemanager.c: In function ‘test_null’:
unit_servicemanager.c:412:15: error: too few arguments to function ‘gbinder_servicemanager_new_with_type’
  412 |     g_assert(!gbinder_servicemanager_new_with_type(0, NULL));
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

and so on

aleasto commented 2 years ago

I updated the tests but i'm unable to verify them, for errors unrelated to this change:

# Start of driver tests
ok 1 /driver/basic
ok 2 /driver/noop
**
ERROR:unit_driver.c:129:test_local_request: assertion failed: (data->bytes->len == sizeof(rpc_header))
Bail out! ERROR:unit_driver.c:129:test_local_request: assertion failed: (data->bytes->len == sizeof(rpc_header))
monich commented 2 years ago

I updated the tests but i'm unable to verify them, for errors unrelated to this change:

That's probably because you have /etc/gbinder.conf on the machine where you're running the tests.

monich commented 2 years ago

I tweaked the implementation a bit, not touching the API. Now it's all merged and tagged. Thanks!