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

Commit 2123089a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7093326 from cc143c8f to sc-release

Change-Id: I4f386ae33aaf98ce3bc258c41fa4629e426942d0
parents 37f36ce9 cc143c8f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -82,7 +82,9 @@ void btif_gatt_check_encrypted_link(RawAddress bd_addr,
           bd_addr, BTM_LE_KEY_PENC, (uint8_t*)&key,
           sizeof(tBTM_LE_PENC_KEYS)) == BT_STATUS_SUCCESS) &&
      !btif_gatt_is_link_encrypted(bd_addr)) {
    BTIF_TRACE_DEBUG("%s: transport = %d", __func__, transport_link);
    LOG_DEBUG("Checking gatt link peer:%s transport:%s",
              PRIVATE_ADDRESS(bd_addr),
              BtTransportText(transport_link).c_str());
    BTA_DmSetEncryption(bd_addr, transport_link, &btif_gatt_set_encryption_cb,
                        BTM_BLE_SEC_ENCRYPT);
  }
+23 −10
Original line number Diff line number Diff line
@@ -47,6 +47,10 @@
#include "common/metrics.h"
#include "main/shim/dumpsys.h"

namespace {
constexpr char kBtmLogTag[] = "HFP";
}

namespace bluetooth {
namespace headset {

@@ -1110,10 +1114,11 @@ bt_status_t HeadsetInterface::PhoneStateChange(
    const char* number, bthf_call_addrtype_t type, const char* name,
    RawAddress* bd_addr) {
  CHECK_BTHF_INIT();
  if (!bd_addr) {
  if (bd_addr == nullptr) {
    LOG_WARN("bd_addr is null");
    return BT_STATUS_FAIL;
  }

  const RawAddress raw_address(*bd_addr);
  int idx = btif_hf_idx_by_bdaddr(bd_addr);
  if (idx < 0 || idx > BTA_AG_MAX_NUM_CLIENTS) {
@@ -1134,14 +1139,13 @@ bt_status_t HeadsetInterface::PhoneStateChange(
              << ", num_held=" << num_held;
    return BT_STATUS_SUCCESS;
  }
  LOG(INFO) << __func__ << ": idx=" << idx << ", addr=" << *bd_addr
            << ", active_bda=" << active_bda << ", num_active=" << num_active
            << ", prev_num_active" << control_block.num_active
            << ", num_held=" << num_held
            << ", prev_num_held=" << control_block.num_held
            << ", call_state=" << dump_hf_call_state(call_setup_state)
            << ", prev_call_state="
            << dump_hf_call_state(control_block.call_setup_state);
  LOG_DEBUG(
      "bd_addr:%s active_bda:%s num_active:%u prev_num_active:%u num_held:%u "
      "prev_num_held:%u call_state:%s prev_call_state:%s",
      PRIVATE_ADDRESS((*bd_addr)), PRIVATE_ADDRESS(active_bda), num_active,
      control_block.num_active, num_held, control_block.num_held,
      dump_hf_call_state(call_setup_state),
      dump_hf_call_state(control_block.call_setup_state));
  tBTA_AG_RES res = BTA_AG_UNKNOWN;
  bt_status_t status = BT_STATUS_SUCCESS;
  bool active_call_updated = false;
@@ -1149,7 +1153,9 @@ bt_status_t HeadsetInterface::PhoneStateChange(
  /* if all indicators are 0, send end call and return */
  if (num_active == 0 && num_held == 0 &&
      call_setup_state == BTHF_CALL_STATE_IDLE) {
    BTM_LogHistory("HFP", raw_address, "Call Ended");
    if (control_block.num_active > 0) {
      BTM_LogHistory(kBtmLogTag, raw_address, "Call Ended");
    }
    BTA_AgResult(control_block.handle, BTA_AG_END_CALL_RES,
                 tBTA_AG_RES_DATA::kEmpty);
    /* if held call was present, reset that as well */
@@ -1288,6 +1294,13 @@ bt_status_t HeadsetInterface::PhoneStateChange(
          snprintf(ag_res.str, sizeof(ag_res.str), "%s",
                   call_number_stream.str().c_str());
        }
        {
          std::string cell_number(number);
          BTM_LogHistory(
              kBtmLogTag, raw_address, "Call Incoming",
              base::StringPrintf("number:%s", PRIVATE_CELL(cell_number)));
        }
        // base::StringPrintf("number:%s", PRIVATE_CELL(number)));
        break;
      case BTHF_CALL_STATE_DIALING:
        if (!(num_active + num_held) && is_active_device(*bd_addr)) {
+0 −1
Original line number Diff line number Diff line
@@ -235,7 +235,6 @@ static void event_start_up_stack(UNUSED_ATTR void* context) {

  bta_set_forward_hw_failures(true);
  btm_acl_device_down();
  BTM_db_reset();
  if (bluetooth::shim::is_gd_controller_enabled()) {
    CHECK(module_start_up(get_module(GD_CONTROLLER_MODULE)));
  } else {
+8 −0
Original line number Diff line number Diff line
@@ -165,6 +165,14 @@ class L2capCaptures(object):
        frame = L2capMatchers.le_control_frame_with_code(packet, LeCommandCode.LE_CREDIT_BASED_CONNECTION_RESPONSE)
        return l2cap_packets.LeCreditBasedConnectionResponseView(frame)

    @staticmethod
    def LinkSecurityInterfaceCallbackEvent(type):
        return Capture(L2capMatchers.LinkSecurityInterfaceCallbackEvent(type), L2capCaptures._extract_address)

    @staticmethod
    def _extract_address(packet):
        return packet.address


class SecurityCaptures(object):

+5 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ class HciMatchers(object):

    @staticmethod
    def LogEventCode():
        return lambda event: logging.info("Received event: %x" % hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(event.event))).GetEventCode())
        return lambda event: logging.info("Received event: %x" % hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(event.payload))).GetEventCode())

    @staticmethod
    def LinkKeyRequest():
@@ -698,6 +698,10 @@ class L2capMatchers(object):
        return response.GetResult() == result and (result != LeCreditBasedConnectionResponseResult.SUCCESS or
                                                   response.GetDestinationCid() != 0)

    @staticmethod
    def LinkSecurityInterfaceCallbackEvent(type):
        return lambda event: True if event.event_type == type else False


class SecurityMatchers(object):

Loading