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

Commit dedc903d authored by Xin Li's avatar Xin Li
Browse files

Merge pi-dev-plus-aosp-without-vendor into stage-aosp-master

Bug: 79597307
Change-Id: Iaccda26437bbee0e9fdbb8ce9af9df8d30946fc2
parents 5f40de10 0616a9cd
Loading
Loading
Loading
Loading
+18 −27
Original line number Diff line number Diff line
@@ -171,28 +171,25 @@ static void bta_pan_data_flow_cb(uint16_t handle, tPAN_RESULT result) {
static void bta_pan_data_buf_ind_cback(uint16_t handle, const RawAddress& src,
                                       const RawAddress& dst, uint16_t protocol,
                                       BT_HDR* p_buf, bool ext, bool forward) {
  tBTA_PAN_SCB* p_scb;
  BT_HDR* p_new_buf;
  tBTA_PAN_SCB* p_scb = bta_pan_scb_by_handle(handle);
  if (p_scb == NULL) {
    return;
  }

  if (sizeof(tBTA_PAN_DATA_PARAMS) > p_buf->offset) {
    /* offset smaller than data structure in front of actual data */
  if (sizeof(BT_HDR) + sizeof(tBTA_PAN_DATA_PARAMS) + p_buf->len >
      PAN_BUF_SIZE) {
    android_errorWriteLog(0x534e4554, "63146237");
    APPL_TRACE_ERROR("%s: received buffer length too large: %d", __func__,
                     p_buf->len);
      osi_free(p_buf);
    return;
  }
    p_new_buf = (BT_HDR*)osi_malloc(PAN_BUF_SIZE);

  BT_HDR* p_new_buf = (BT_HDR*)osi_malloc(PAN_BUF_SIZE);
  memcpy((uint8_t*)(p_new_buf + 1) + sizeof(tBTA_PAN_DATA_PARAMS),
         (uint8_t*)(p_buf + 1) + p_buf->offset, p_buf->len);
  p_new_buf->len = p_buf->len;
  p_new_buf->offset = sizeof(tBTA_PAN_DATA_PARAMS);
    osi_free(p_buf);
  } else {
    p_new_buf = p_buf;
  }

  /* copy params into the space before the data */
  ((tBTA_PAN_DATA_PARAMS*)p_new_buf)->src = src;
  ((tBTA_PAN_DATA_PARAMS*)p_new_buf)->dst = dst;
@@ -200,12 +197,6 @@ static void bta_pan_data_buf_ind_cback(uint16_t handle, const RawAddress& src,
  ((tBTA_PAN_DATA_PARAMS*)p_new_buf)->ext = ext;
  ((tBTA_PAN_DATA_PARAMS*)p_new_buf)->forward = forward;

  p_scb = bta_pan_scb_by_handle(handle);
  if (p_scb == NULL) {
    osi_free(p_new_buf);
    return;
  }

  fixed_queue_enqueue(p_scb->data_queue, p_new_buf);
  BT_HDR* p_event = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
  p_event->layer_specific = handle;
+7 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@
#include "btif_util.h"
#include "btu.h"
#include "device/include/interop.h"
#include "log/log.h"
#include "osi/include/list.h"
#include "osi/include/osi.h"
#include "osi/include/properties.h"
@@ -3538,6 +3539,12 @@ static void handle_app_cur_val_response(tBTA_AV_META_MSG* pmeta_msg,


  app_settings.num_attr = p_rsp->num_val;

  if (app_settings.num_attr > BTRC_MAX_APP_SETTINGS) {
    android_errorWriteLog(0x534e4554, "73824150");
    app_settings.num_attr = BTRC_MAX_APP_SETTINGS;
  }

  for (xx = 0; xx < app_settings.num_attr; xx++) {
    app_settings.attr_ids[xx] = p_rsp->p_vals[xx].attr_id;
    app_settings.attr_values[xx] = p_rsp->p_vals[xx].attr_val;
+12 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
 ******************************************************************************/

#include "osi/include/config.h"
#include "log/log.h"

#include <base/files/file_path.h>
#include <base/logging.h>
@@ -170,14 +171,23 @@ void config_set_string(config_t* config, const std::string& section,
    sec = std::prev(config->sections.end());
  }

  std::string value_no_newline;
  size_t newline_position = value.find("\n");
  if (newline_position != std::string::npos) {
    android_errorWriteLog(0x534e4554, "70808273");
    value_no_newline = value.substr(0, newline_position);
  } else {
    value_no_newline = value;
  }

  for (entry_t& entry : sec->entries) {
    if (entry.key == key) {
      entry.value = value;
      entry.value = value_no_newline;
      return;
    }
  }

  sec->entries.emplace_back(entry_t{.key = key, .value = value});
  sec->entries.emplace_back(entry_t{.key = key, .value = value_no_newline});
}

bool config_remove_section(config_t* config, const std::string& section) {
+1 −1
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ TEST_F(AvrcpConnectionHandlerTest, notConnectedDisconnectTest) {
  ConnectionHandler::CleanUp();
};

// Check that disconnecting without an active connection
// Test calling the connection callback after the handler is cleaned up
TEST_F(AvrcpConnectionHandlerTest, disconnectAfterCleanupTest) {
  // Set an Expectation that Open will be called twice as an acceptor and save
  // the connection callback once it is called.
+3 −0
Original line number Diff line number Diff line
@@ -294,6 +294,9 @@ cc_test {
    srcs: [
        "smp/smp_keys.cc",
        "smp/aes.cc",
        "smp/p_256_curvepara.cc",
        "smp/p_256_ecc_pp.cc",
        "smp/p_256_multprecision.cc",
        "smp/smp_api.cc",
        "smp/smp_main.cc",
        "smp/smp_utils.cc",
Loading