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

Commit d15251b8 authored by Chen Chen's avatar Chen Chen Committed by Automerger Merge Worker
Browse files

Merge "BluetoothMetrics: Log HFP connection failure reasons from btif_hf" am: 05b59f02

parents 49797aa8 05b59f02
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -27,12 +27,16 @@

#define LOG_TAG "bt_btif_hf"

#include <base/logging.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>

#include <cstdint>
#include <string>

#include "bta/include/bta_ag_api.h"
#include "bta/include/utl.h"
#include "btif/include/btif_common.h"
#include "btif/include/btif_metrics_logging.h"
#include "btif/include/btif_profile_queue.h"
#include "btif/include/btif_util.h"
#include "common/metrics.h"
@@ -44,8 +48,6 @@
#include "stack/include/btm_api.h"
#include "types/raw_address.h"

#include <base/logging.h>

namespace {
constexpr char kBtmLogTag[] = "HFP";
}
@@ -339,6 +341,10 @@ static void btif_hf_upstreams_evt(uint16_t event, char* p_param) {
                         << ", report disconnect state for p_data bda.";
            bt_hf_callbacks->ConnectionStateCallback(
                BTHF_CONNECTION_STATE_DISCONNECTED, &(p_data->open.bd_addr));
            log_counter_metrics_btif(
                android::bluetooth::CodePathCounterKeyEnum::
                    HFP_COLLISON_AT_AG_OPEN,
                1);
          }
          break;
        }
@@ -358,6 +364,9 @@ static void btif_hf_upstreams_evt(uint16_t event, char* p_param) {
          bt_hf_callbacks->ConnectionStateCallback(
              BTHF_CONNECTION_STATE_DISCONNECTED,
              &(btif_hf_cb[idx].connected_bda));
          log_counter_metrics_btif(android::bluetooth::CodePathCounterKeyEnum::
                                       HFP_COLLISON_AT_CONNECTING,
                                   1);
          reset_control_block(&btif_hf_cb[idx]);
          btif_queue_advance();
        }
@@ -387,6 +396,9 @@ static void btif_hf_upstreams_evt(uint16_t event, char* p_param) {
        reset_control_block(&btif_hf_cb[idx]);
        bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state,
                                                 &connected_bda);
        log_counter_metrics_btif(android::bluetooth::CodePathCounterKeyEnum::
                                     HFP_SELF_INITIATED_AG_FAILED,
                                 1);
        btif_queue_advance();
      }
      break;
@@ -406,6 +418,9 @@ static void btif_hf_upstreams_evt(uint16_t event, char* p_param) {
                                               &connected_bda);
      if (failed_to_setup_slc) {
        LOG(ERROR) << __func__ << ": failed to setup SLC for " << connected_bda;
        log_counter_metrics_btif(
            android::bluetooth::CodePathCounterKeyEnum::HFP_SLC_SETUP_FAILED,
            1);
        btif_queue_advance();
      }
      break;