Commit Graph

18 Commits

Author SHA1 Message Date
Slava Monich
6d71a0649c [gbinder] Housekeeping 2024-07-18 05:32:36 +03:00
Slava Monich
b5bab2431e [unit] Make unit tests independent on system config. JB#42956
System gbinder config shouldn't break unit tests.
2023-11-19 18:41:26 +02:00
Slava Monich
d7eacd455f [unit] Refactored binder simulation. JB#42956
The old one was way too hackish and prone to race conditions.
This one is more accurate and hopefully more reliable.
2023-01-04 14:42:19 +02:00
Slava Monich
865a29d1dd [unit] Tests should ignore system config 2022-06-11 02:49:02 +03:00
Slava Monich
93fbb5b238 [gbinder] Housekeeping. JB#42254 2022-06-11 02:08:05 +03:00
Slava Monich
f088e6d1bb [unit] Make unit tests comptible with glib < 2.36
g_type_init() was required back then, whenever a GObject is touched.
2021-08-30 19:32:21 +03:00
Slava Monich
82f71a6c91 [gbinder] Support for passing object references via proxy. JB#52557
GBinderProxyObject automatically creates proxies for the remote objects
found in the transaction payload.
2021-03-02 17:53:53 +02:00
Slava Monich
3ef00effc5 [unit] Call gbinder_ipc_exit() when appropriate. Fixes JB#52595
If a test calls test_binder_set_looper_enabled(fd, TRUE) to enable
processing of incoming data by the looper thread, the same thread
may get picked up by the next test and swallow the reply before the
transaction (for which the reply was intended) has been submitted.
Which may cause that next test to either fail or (if the transaction
was synchronous) block forever, stalling the build.

Calling gbinder_ipc_exit() makes sure that looper thread terminates
before the next test starts.
2020-12-22 23:50:37 +02:00
Slava Monich
92392f5c9a [gbinder] Made RPC protocol configurable per device. JB#51844
Custom device-to-protocol mapping can be provided via /etc/gbinder.conf
and the default config looks like this:

  [Protocol]
  Default = aidl
  /dev/binder = aidl
  /dev/hwbinder = hidl
2020-12-03 20:15:33 +02:00
Slava Monich
721f5dc469 [gbinder] Made gbinder_local_object_new() public. JB#44551
Until now, gbinder_servicemanager_new_local_object() was the only
API for creating local objects. That was slightly weird because
creating local object don't have much to do servicemanager, it's
a purely local operation. All we need to know is which binder
device (GBinderIpc) the object is going to be associated with.
That's what gbinder_remote_object_ipc() is for.
2019-02-19 23:56:29 +02:00
Slava Monich
a0ce447a1f [gbinder] Add gbinder_servicemanager_new_local_object2. Fixes JB#44766
It allows to pass a list of interfaces (top-most interface first) for
HIDL_DESCRIPTOR_CHAIN_TRANSACTION to GBinderLocalObject.
2019-02-14 12:31:54 +03:00
Slava Monich
68e9358d02 [gbinder] Added tests for PING and INTERFACE transactions 2019-01-22 17:36:02 +02:00
Slava Monich
307bd6942c [gbinder] Added servicemanager presence API. JB#42956
This function allows to wait for servicemanager synchronously,
blocking the event loop in the process (not recommended):

  gbinder_servicemanager_wait()

These two allow to follow the presence state of servicemanager
without blocking the event loop:

  gbinder_servicemanager_is_present()
  gbinder_servicemanager_add_presence_handler()

Note that services need to re-add their names to servicemanager
after it has restarted. This can be done by the presence handler.
2019-01-20 14:12:25 +02:00
Slava Monich
3e039e033c [gbinder] Close descriptors associated with transactions. Fixes JB#44099
Those are coming as objects of type BINDER_TYPE_FD and the
receiving side has to close them.
2018-12-08 03:12:22 +02:00
Slava Monich
6ea0d6c631 [unit] Added test for HIDL_PING_TRANSACTION 2018-12-04 15:07:27 +02:00
Slava Monich
8a27829af3 [gbinder] Make sure RPC protocol matches servicemanager type
This makes it easier to use non-standard binder device name.
2018-09-22 12:15:20 +03:00
Slava Monich
7d13daa426 [gbinder] Getters for pid/euid of GBinderRemoteRequest. JB#41335
Can be used for access control.
2018-07-25 00:36:02 +03:00
Slava Monich
fb981c9983 [gbinder] C interface for Android binder. JB#41335 2018-07-15 17:38:51 +03:00