diff options
| author | 2021-08-09 18:43:41 +0000 | |
|---|---|---|
| committer | 2021-08-09 18:43:41 +0000 | |
| commit | 43f81cefc664a2e5a5358a928748d97a4bb7af4c (patch) | |
| tree | 04014d59e730bbf383b7f9856239e1fae33158b3 | |
| parent | b79e5aff6ff50506b628f7e574940cfa66c7af7c (diff) | |
| parent | 81809face4661e9d41205d72f630b37093b0fe22 (diff) | |
Merge "binderRpcTest: work when vsock not supported" am: bf5fdedf6f am: 81809face4
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1788713
Change-Id: I80fc4f46dd27cd15766d66f50461d7dc04736abf
| -rw-r--r-- | libs/binder/tests/binderRpcTest.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp index 6dd4019ae8..15ccae9399 100644 --- a/libs/binder/tests/binderRpcTest.cpp +++ b/libs/binder/tests/binderRpcTest.cpp @@ -1196,7 +1196,12 @@ static bool testSupportVsockLoopback() { unsigned int vsockPort = allocateVsockPort(); sp<RpcServer> server = RpcServer::make(RpcTransportCtxFactoryRaw::make()); server->iUnderstandThisCodeIsExperimentalAndIWillNotUseItInProduction(); - CHECK_EQ(OK, server->setupVsockServer(vsockPort)); + if (status_t status = server->setupVsockServer(vsockPort); status != OK) { + if (status == -EAFNOSUPPORT) { + return false; + } + LOG_ALWAYS_FATAL("Could not setup vsock server: %s", statusToString(status).c_str()); + } server->start(); sp<RpcSession> session = RpcSession::make(RpcTransportCtxFactoryRaw::make()); |