summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--trunks/trunks_binder_proxy.cc8
-rw-r--r--trunks/trunks_binder_service.cc12
-rw-r--r--trunks/trunks_binder_service.h6
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<int8_t>& response_proto_data) override {
+ const std::vector<uint8_t>& 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<int8_t> command_proto_data;
+ std::vector<uint8_t> 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<int8_t> command_proto_data;
+ std::vector<uint8_t> 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<int8_t> response_proto_data;
+ std::vector<uint8_t> 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<int8_t>& command,
+bool ParseCommandProto(const std::vector<uint8_t>& 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<int8_t>& command,
}
void CreateResponseProto(const std::string& data,
- std::vector<int8_t>* response) {
+ std::vector<uint8_t>* 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<int8_t>& command,
+ const std::vector<uint8_t>& command,
const android::sp<android::trunks::ITrunksClient>& 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<android::trunks::ITrunksClient>& client,
const std::string& response) {
- std::vector<int8_t> binder_response;
+ std::vector<uint8_t> 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<int8_t>& command,
- std::vector<int8_t>* response) {
+ const std::vector<uint8_t>& command,
+ std::vector<uint8_t>* 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<int8_t>& command,
+ const std::vector<uint8_t>& command,
const android::sp<android::trunks::ITrunksClient>& client) override;
android::binder::Status SendCommandAndWait(
- const std::vector<int8_t>& command,
- std::vector<int8_t>* response) override;
+ const std::vector<uint8_t>& command,
+ std::vector<uint8_t>* response) override;
private:
void OnResponse(const android::sp<android::trunks::ITrunksClient>& client,