Previously to cross-compile one would need to add a pkg-config
executable in $PATH wrapping all the search paths required; now one can
e.g.
make PKG_CONFIG=foreign-arch-target-pkg-config
with the wrapper executable being separate and allowing programs for
host to also be built if needed for example.
The /proxy_object/param test could be deadlocked by gbinder_ipc_exit()
blocking the main thread and waiting for all client threads to terminate
one of which waiting for the transaction (the one getting cancelled) to
complete on the main thread blocked by gbinder_ipc_exit().
The deadlock is avoided by making sure that both transactions get completed
before gbinder_ipc_exit() is called.
Note that libhwbinder and libbinder encode TRUE value differently
on big-endian machines (0x01 becomes either first or last of 4 bytes)
but reading uint32 and comparing it with zero works in either case.
Introduce "aidl4" variant of service manager to adapt the change
to service related protocol for Android 12.
From Android 12, when reading nullable strong binder, the format of
the `stability` field passed on the wire was changed and evolved to
`struct Category`, which consists of the following members with 4 bytes long.
```
struct Category {
uint8_t version;
uint8_t reserved[2];
Level level; <- bitmask of Stability::Level
}
```
Please check the following link for details:
https://cs.android.com/android/platform/superproject/+/android-12.0.0_r3:frameworks/native/libs/binder/include/binder/Stability.h;l=140
To honor the change on AOSP side for Android 12, we need to adapt
the protocol change in Service Manager.
==642984== HEAP SUMMARY:
==642984== in use at exit: 1,097,253 bytes in 557 blocks
==642984== total heap usage: 4,780 allocs, 4,223 frees, 78,991,940 bytes allocated
==642984==
==642984== 1,040,520 (24 direct, 1,040,496 indirect) bytes in 1 blocks are definitely lost in loss record 475 of 475
==642984== at 0x483B7F3: malloc
==642984== by 0x4923E98: g_malloc
==642984== by 0x493C485: g_slice_alloc
==642984== by 0x493CAAD: g_slice_alloc0
==642984== by 0x11CA1E: gbinder_buffer_alloc (gbinder_buffer.c:167)
==642984== by 0x11CAFD: gbinder_buffer_new (gbinder_buffer.c:195)
==642984== by 0x1192C9: test_parcelable (unit_reader.c:1728)
==642984== by 0x494658D: ???
==642984== by 0x4946A79: g_test_run_suite
==642984== by 0x4946A94: g_test_run
==642984== by 0x11C719: main (unit_reader.c:2448)
==642984==
Parcelables allow to serialize arbitrary objects inside
an AIDL parcel.
The structure is pretty simple, and is as follows:
* (int32) Control integer that signals whether there is content (1),
or not (0)
* (int32) Integer holding the payload size, including itself
* The actual payload
Signed-off-by: Eugenio Paolantonio (g7) <me@medesimo.eu>
Introduce "aidl3" variant of service manager to adapt the changes
to service related protocol in Android 11.
List services command no longer has index parameter and all data
is in single transaction.
Add service command now has additional "stability" parameter.
Due to the following change in the upstream,
d70160f298%5E%21/#F0
The system and vendor binder have a different header in Android 11.
To adapt this change to Android 11, we have to introduce a new
"aidl3" variant of service manager in libgbinder, which target to
Android 11 or higher if the rpc protocol remains for the upcoming
major Android release.