libbinder: clear RpcSession::mStartedSetup in case of error
Clear the mStartedSetup flag in case of error return from
RpcSession::setupClient and its callees so that the setup
can be retried and/or the RpcSession reused.
Bug: 242473043
Test: m
Change-Id: I4fa99ab9eb136756ee7344c73f2b3f57a7412e3f
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp
index d347262..8ddfa93 100644
--- a/libs/binder/RpcSession.cpp
+++ b/libs/binder/RpcSession.cpp
@@ -484,6 +484,9 @@
mProtocolVersion = oldProtocolVersion;
mConnections = {};
+
+ // clear mStartedSetup so that we can reuse this RpcSession
+ mStartedSetup = false;
});
if (status_t status = connectAndInit({}, false /*incoming*/); status != OK) return status;