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

Commit 4642c41b authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "RPC Binder: Retry Trusty connections several times" am: 7d1e6a83 am:...

Merge "RPC Binder: Retry Trusty connections several times" am: 7d1e6a83 am: 8e0faae4 am: 553da0de

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2500358



Change-Id: Idafff6926672b7e1253f3f7ad4e836631a3d6c68
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1b4cbc46 553da0de
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -382,9 +382,16 @@ std::unique_ptr<ProcessSession> BinderRpc::createRpcTestSocketServerProcessEtc(
                status = session->setupPreconnectedClient({}, [=]() {
#ifdef BINDER_RPC_TO_TRUSTY_TEST
                    auto port = trustyIpcPort(serverVersion);
                    for (size_t i = 0; i < 5; i++) {
                        // Try to connect several times,
                        // in case the service is slow to start
                        int tipcFd = tipc_connect(kTrustyIpcDevice, port.c_str());
                    return tipcFd >= 0 ? android::base::unique_fd(tipcFd)
                                       : android::base::unique_fd();
                        if (tipcFd >= 0) {
                            return android::base::unique_fd(tipcFd);
                        }
                        usleep(50000);
                    }
                    return android::base::unique_fd();
#else
                    LOG_ALWAYS_FATAL("Tried to connect to Trusty outside of vendor");
                    return android::base::unique_fd();