From bf57bcef60c2619e07e5dad6deda336e6dde8626 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 26 Jul 2021 15:26:12 -0700 Subject: libbinder: RPC binder - incl. protocol version Bug: 182938972 Test: binderRpcTest Change-Id: I135fa44b111d92b53161775dea90a42e4cb5bee1 --- libs/binder/RpcState.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libs/binder/RpcState.cpp') diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp index 332c75f9e7..f3406bb10b 100644 --- a/libs/binder/RpcState.cpp +++ b/libs/binder/RpcState.cpp @@ -315,6 +315,18 @@ status_t RpcState::rpcRec(const sp& connection, return OK; } +status_t RpcState::readNewSessionResponse(const sp& connection, + const sp& session, uint32_t* version) { + RpcNewSessionResponse response; + if (status_t status = + rpcRec(connection, session, "new session response", &response, sizeof(response)); + status != OK) { + return status; + } + *version = response.version; + return OK; +} + status_t RpcState::sendConnectionInit(const sp& connection, const sp& session) { RpcOutgoingConnectionInit init{ -- cgit v1.2.3-59-g8ed1b