From 8e9be04bfdf8501018518989a56f588e136deaf0 Mon Sep 17 00:00:00 2001 From: Casey Dahlin Date: Tue, 9 Feb 2016 12:10:24 -0800 Subject: Update binder interfaces for AIDL change in byte[] type byte[] is now uint8_t in AIDL. We need to accomodate this. Change-Id: I15ed5948c99bba0783802ca607a2420b5b05aa57 Test: Build succeeds against new AIDL Bug: 27078230 (cherry picked from commit 8805184cdaef79c997db25aff527042606e98abe) --- trunks/trunks_binder_proxy.cc | 8 ++++---- trunks/trunks_binder_service.cc | 12 ++++++------ trunks/trunks_binder_service.h | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/trunks/trunks_binder_proxy.cc b/trunks/trunks_binder_proxy.cc index 772afc7..ed1052a 100644 --- a/trunks/trunks_binder_proxy.cc +++ b/trunks/trunks_binder_proxy.cc @@ -38,7 +38,7 @@ class ResponseObserver : public android::trunks::BnTrunksClient { // ITrunksClient interface. android::binder::Status OnCommandResponse( - const std::vector& response_proto_data) override { + const std::vector& response_proto_data) override { trunks::SendCommandResponse response_proto; if (!response_proto.ParseFromArray(response_proto_data.data(), response_proto_data.size())) { @@ -74,7 +74,7 @@ void TrunksBinderProxy::SendCommand(const std::string& command, const ResponseCallback& callback) { SendCommandRequest command_proto; command_proto.set_command(command); - std::vector command_proto_data; + std::vector command_proto_data; command_proto_data.resize(command_proto.ByteSize()); if (!command_proto.SerializeToArray(command_proto_data.data(), command_proto_data.size())) { @@ -95,14 +95,14 @@ void TrunksBinderProxy::SendCommand(const std::string& command, std::string TrunksBinderProxy::SendCommandAndWait(const std::string& command) { SendCommandRequest command_proto; command_proto.set_command(command); - std::vector command_proto_data; + std::vector command_proto_data; command_proto_data.resize(command_proto.ByteSize()); if (!command_proto.SerializeToArray(command_proto_data.data(), command_proto_data.size())) { LOG(ERROR) << "TrunksBinderProxy: Failed to serialize protobuf."; return CreateErrorResponse(TRUNKS_RC_IPC_ERROR); } - std::vector response_proto_data; + std::vector response_proto_data; android::binder::Status status = trunks_service_->SendCommandAndWait( command_proto_data, &response_proto_data); if (!status.isOk()) { diff --git a/trunks/trunks_binder_service.cc b/trunks/trunks_binder_service.cc index 028aa3c..b8b72b5 100644 --- a/trunks/trunks_binder_service.cc +++ b/trunks/trunks_binder_service.cc @@ -30,7 +30,7 @@ namespace { // If |command| is a valid command protobuf, provides the |command_data| and // returns true. Otherwise, returns false. -bool ParseCommandProto(const std::vector& command, +bool ParseCommandProto(const std::vector& command, std::string* command_data) { trunks::SendCommandRequest request_proto; if (!request_proto.ParseFromArray(command.data(), command.size()) || @@ -42,7 +42,7 @@ bool ParseCommandProto(const std::vector& command, } void CreateResponseProto(const std::string& data, - std::vector* response) { + std::vector* response) { trunks::SendCommandResponse response_proto; response_proto.set_response(data); response->resize(response_proto.ByteSize()); @@ -75,7 +75,7 @@ TrunksBinderService::BinderServiceInternal::BinderServiceInternal( : service_(service) {} android::binder::Status TrunksBinderService::BinderServiceInternal::SendCommand( - const std::vector& command, + const std::vector& command, const android::sp& client) { auto callback = base::Bind(&TrunksBinderService::BinderServiceInternal::OnResponse, @@ -93,7 +93,7 @@ android::binder::Status TrunksBinderService::BinderServiceInternal::SendCommand( void TrunksBinderService::BinderServiceInternal::OnResponse( const android::sp& client, const std::string& response) { - std::vector binder_response; + std::vector binder_response; CreateResponseProto(response, &binder_response); android::binder::Status status = client->OnCommandResponse(binder_response); if (!status.isOk()) { @@ -104,8 +104,8 @@ void TrunksBinderService::BinderServiceInternal::OnResponse( android::binder::Status TrunksBinderService::BinderServiceInternal::SendCommandAndWait( - const std::vector& command, - std::vector* response) { + const std::vector& command, + std::vector* response) { std::string command_data; if (!ParseCommandProto(command, &command_data)) { LOG(ERROR) << "TrunksBinderService: Bad command data."; diff --git a/trunks/trunks_binder_service.h b/trunks/trunks_binder_service.h index 7f809ac..0352b74 100644 --- a/trunks/trunks_binder_service.h +++ b/trunks/trunks_binder_service.h @@ -57,11 +57,11 @@ class TrunksBinderService : public brillo::Daemon { // ITrunks interface. android::binder::Status SendCommand( - const std::vector& command, + const std::vector& command, const android::sp& client) override; android::binder::Status SendCommandAndWait( - const std::vector& command, - std::vector* response) override; + const std::vector& command, + std::vector* response) override; private: void OnResponse(const android::sp& client, -- cgit v1.2.3