summaryrefslogtreecommitdiff
path: root/osi
diff options
context:
space:
mode:
authorAjay Panicker <apanicke@google.com>2016-02-17 18:18:00 -0800
committerAndre Eisenbach <eisenbach@google.com>2016-02-18 13:36:25 -0800
commite064f0846d382180a7955b7e45fcb73fa13ff992 (patch)
tree23383b90a7a7d1765ad0bf6a52d32b2f4b3b4e20 /osi
parent512fabd174f38ba423bd057a3687623ea3b9deb4 (diff)
downloadandroid-system-bt-e064f0846d382180a7955b7e45fcb73fa13ff992.tar.gz
android-system-bt-e064f0846d382180a7955b7e45fcb73fa13ff992.tar.xz
Write Protobuf in Base64
Change-Id: I3868365e7fd166517b13ff03a15d629271bd47b4
Diffstat (limited to 'osi')
-rw-r--r--osi/Android.mk8
-rw-r--r--osi/src/metrics.cpp6
2 files changed, 9 insertions, 5 deletions
diff --git a/osi/Android.mk b/osi/Android.mk
index d2ee7ab..e6af855 100644
--- a/osi/Android.mk
+++ b/osi/Android.mk
@@ -117,7 +117,7 @@ LOCAL_C_INCLUDES := $(btosiCommonIncludes)
LOCAL_SRC_FILES := $(btosiCommonSrc)
LOCAL_MODULE := libosi
LOCAL_MODULE_TAGS := optional
-LOCAL_SHARED_LIBRARIES := libc liblog
+LOCAL_SHARED_LIBRARIES := libc liblog libchrome
LOCAL_STATIC_LIBRARIES := libbt-protos
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
@@ -135,7 +135,7 @@ LOCAL_C_INCLUDES := $(btosiCommonIncludes)
LOCAL_SRC_FILES := $(btosiCommonSrc)
LOCAL_MODULE := libosi-host
LOCAL_MODULE_TAGS := optional
-LOCAL_SHARED_LIBRARIES := liblog
+LOCAL_SHARED_LIBRARIES := liblog libchrome
LOCAL_STATIC_LIBRARIES := libbt-protos
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
@@ -160,7 +160,7 @@ LOCAL_C_INCLUDES := $(btosiCommonIncludes)
LOCAL_SRC_FILES := $(btosiCommonTestSrc)
LOCAL_MODULE := net_test_osi
LOCAL_MODULE_TAGS := tests
-LOCAL_SHARED_LIBRARIES := liblog libprotobuf-cpp-full
+LOCAL_SHARED_LIBRARIES := liblog libprotobuf-cpp-full libchrome
LOCAL_STATIC_LIBRARIES := libosi libbt-protos
LOCAL_CFLAGS += $(bluetooth_CFLAGS)
@@ -178,7 +178,7 @@ LOCAL_SRC_FILES := $(btosiCommonTestSrc)
LOCAL_LDLIBS := -lrt -lpthread
LOCAL_MODULE := net_test_osi
LOCAL_MODULE_TAGS := tests
-LOCAL_SHARED_LIBRARIES := liblog libprotobuf-cpp-full
+LOCAL_SHARED_LIBRARIES := liblog libprotobuf-cpp-full libchrome
LOCAL_STATIC_LIBRARIES := libosi-host libbt-protos
LOCAL_CFLAGS += $(bluetooth_CFLAGS)
diff --git a/osi/src/metrics.cpp b/osi/src/metrics.cpp
index 63be98a..bb3b0f1 100644
--- a/osi/src/metrics.cpp
+++ b/osi/src/metrics.cpp
@@ -30,6 +30,7 @@ extern "C" {
#include "osi/src/protos/bluetooth.pb.h"
+#include <base/base64.h>
#include <google/protobuf/text_format.h>
using clearcut::connectivity::A2DPSession;
@@ -180,7 +181,10 @@ void metrics_write(int fd, bool clear) {
return;
}
- if (write(fd, serialized.c_str(), serialized.size()) == -1) {
+ std::string protoBase64;
+ base::Base64Encode(serialized, &protoBase64);
+
+ if (write(fd, protoBase64.c_str(), protoBase64.size()) == -1) {
LOG_ERROR(LOG_TAG, "%s: error writing to dumpsys fd: %s (%d)", __func__,
strerror(errno), errno);
}