Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1eab345b authored by Steven Moreland's avatar Steven Moreland
Browse files

binderRpcTest: work when vsock not supported

If vsock isn't supported at all, don't abort.

Bug: 167966510
Test: binderRpcTest (on Pixel 3)
Change-Id: I3384349eb63dea99aa8f3f0f91a8719e0f85a76a
parent 2372f9d8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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());