libpdx_uds: Fix send/receive over socket to handle signal interrupts
Previous implementation of send/receive didn't account for the fact that
send/receive operation might be interrupted by a signal and transfer
fewer bytes than requested.
Fix this by repeatedly calling send/recv until all the requested data
is transferred over sockets.
Also added a number of unit tests for send/receive functions.
Bug: 37427314
Test: `m -j32` succeeds for Sailfish.
`libpdx_uds_tests` pass on device
Change-Id: Ib8f78967af3c218d9f18fb3dfe8953c35800540b
diff --git a/libs/vr/libpdx_uds/Android.bp b/libs/vr/libpdx_uds/Android.bp
index a73ba34..f2bcc0c 100644
--- a/libs/vr/libpdx_uds/Android.bp
+++ b/libs/vr/libpdx_uds/Android.bp
@@ -35,10 +35,12 @@
"-Werror",
],
srcs: [
+ "ipc_helper_tests.cpp",
"remote_method_tests.cpp",
"service_framework_tests.cpp",
],
static_libs: [
+ "libgmock",
"libpdx_uds",
"libpdx",
],