libbinder: RPC use 'status_t' over 'bool'
For ease of debugging/handling errors (I realized that binderRpcTest
currently crashes on Pixel 3 because of some missing kernel patches -
this would have been easier with this, and one potential (even if
temporary) solution would be to check the return code).
Bug: 167966510
Test: binderRpcTest, binderRpcBenchmark, binder_parcel_fuzzer,
binder_rpc_fuzzer, binderHostDeviceTest
Change-Id: I1baa2e9380e0ec8f82f8ceb250f3eeb632dc5fbc
diff --git a/libs/binder/tests/binderHostDeviceTest.cpp b/libs/binder/tests/binderHostDeviceTest.cpp
index 5dd9212..3f72b8f 100644
--- a/libs/binder/tests/binderHostDeviceTest.cpp
+++ b/libs/binder/tests/binderHostDeviceTest.cpp
@@ -101,8 +101,9 @@
[[nodiscard]] static sp<IBinder> get(unsigned int hostPort) {
auto rpcSession = RpcSession::make();
- if (!rpcSession->setupInetClient("127.0.0.1", hostPort)) {
- ADD_FAILURE() << "Failed to setupInetClient on " << hostPort;
+ if (status_t status = rpcSession->setupInetClient("127.0.0.1", hostPort); status != OK) {
+ ADD_FAILURE() << "Failed to setupInetClient on " << hostPort << ": "
+ << statusToString(status);
return nullptr;
}
return rpcSession->getRootObject();