Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4425497 authored by Ajay Panicker's avatar Ajay Panicker Committed by Andre Eisenbach
Browse files

Write Protobuf in Base64

Change-Id: I3868365e7fd166517b13ff03a15d629271bd47b4
parent db270dc8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -62,7 +62,8 @@ LOCAL_SHARED_LIBRARIES := \
    libpower \
    libprotobuf-cpp-full \
    libmedia \
    libutils
    libutils \
    libchrome

LOCAL_STATIC_LIBRARIES := \
    libbt-qcom_sbc_decoder
+4 −4
Original line number Diff line number Diff line
@@ -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)
+5 −1
Original line number Diff line number Diff line
@@ -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);
  }