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

Commit 435ee957 authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi Committed by Automerger Merge Worker
Browse files

Revert "[BluetoothMetrics] This covers the case for Direct LE-AC..." am: 5a00b850

parents a59dea37 5a00b850
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@

#include <base/base64.h>
#include <base/logging.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/le/enums.pb.h>
#include <include/hardware/bt_av.h>
#include <statslog_bt.h>
#include <unistd.h>
@@ -36,9 +35,6 @@

#include "address_obfuscator.h"
#include "bluetooth/metrics/bluetooth.pb.h"
#include "gd/metrics/metrics_state.h"
#include "gd/hci/address.h"
#include "gd/os/metrics.h"
#include "leaky_bonded_queue.h"
#include "metric_id_allocator.h"
#include "osi/include/osi.h"
@@ -72,7 +68,6 @@ using bluetooth::metrics::BluetoothMetricsProto::ScanEvent_ScanEventType;
using bluetooth::metrics::BluetoothMetricsProto::ScanEvent_ScanTechnologyType;
using bluetooth::metrics::BluetoothMetricsProto::WakeEvent;
using bluetooth::metrics::BluetoothMetricsProto::WakeEvent_WakeEventType;
using bluetooth::hci::Address;

static float combine_averages(float avg_a, int64_t ct_a, float avg_b,
                              int64_t ct_b) {
@@ -974,19 +969,6 @@ void LogLeAudioBroadcastSessionReported(int64_t duration_nanos) {
  }
}

void LogLeBluetoothConnectionMetricEventReported(
    const Address& address,
    android::bluetooth::le::LeConnectionOriginType origin_type,
    android::bluetooth::le::LeConnectionType connection_type,
    android::bluetooth::le::LeConnectionState transaction_state,
    std::vector<std::pair<os::ArgumentType, int>>
        argument_list) {
  // Log the events for the State Management
  metrics::MetricsCollector::GetLEConnectionMetricsCollector()
      ->AddStateChangedEvent(address, origin_type, connection_type,
                             transaction_state, argument_list);
}

}  // namespace common

}  // namespace bluetooth
+0 −11
Original line number Diff line number Diff line
@@ -21,16 +21,13 @@
#include <bta/include/bta_api.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/le/enums.pb.h>
#include <stdint.h>

#include <memory>
#include <string>
#include <vector>

#include "gd/os/metrics.h"
#include "types/raw_address.h"
#include "hci/address.h"

namespace bluetooth {

@@ -523,14 +520,6 @@ void LogLeAudioConnectionSessionReported(

void LogLeAudioBroadcastSessionReported(int64_t duration_nanos);

void LogLeBluetoothConnectionMetricEventReported(
    const RawAddress& raw_address,
    android::bluetooth::le::LeConnectionOriginType origin_type,
    android::bluetooth::le::LeConnectionType connection_type,
    android::bluetooth::le::LeConnectionState transaction_state,
    std::vector<std::pair<os::ArgumentType, int>>
        argument_list);

}  // namespace common

}  // namespace bluetooth
+0 −1
Original line number Diff line number Diff line
@@ -426,7 +426,6 @@ cc_test {
        "libbt_callbacks_cxx",
        "libbt_shim_bridge",
        "libbt_shim_ffi",
        "libbt-platform-protos-lite"
    ],
    shared_libs: [
        "libcrypto",
+3 −44
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@
#include "hci/le_address_manager.h"
#include "os/alarm.h"
#include "os/handler.h"
#include "os/metrics.h"
#include "os/system_properties.h"
#include "packet/packet_view.h"

@@ -343,16 +342,6 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
    AddressWithType remote_address(address, peer_address_type);
    AddressWithType local_address = le_address_manager_->GetInitiatorAddress();
    const bool in_filter_accept_list = is_device_in_connect_list(remote_address);
    auto argument_list = std::vector<std::pair<bluetooth::os::ArgumentType, int>>();
    argument_list.push_back(
        std::make_pair(os::ArgumentType::ACL_STATUS_CODE, static_cast<int>(status)));

    bluetooth::os::LogMetricBluetoothLEConnectionMetricEvent(
        address,
        android::bluetooth::le::LeConnectionOriginType::ORIGIN_NATIVE,
        android::bluetooth::le::LeConnectionType::CONNECTION_TYPE_LE_ACL,
        android::bluetooth::le::LeConnectionState::STATE_LE_ACL_END,
        argument_list);

    if (role == hci::Role::CENTRAL) {
      connectability_state_ = ConnectabilityState::DISARMED;
@@ -496,16 +485,6 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
    }
    AddressWithType remote_address(address, remote_address_type);
    const bool in_filter_accept_list = is_device_in_connect_list(remote_address);
    auto argument_list = std::vector<std::pair<bluetooth::os::ArgumentType, int>>();
    argument_list.push_back(
        std::make_pair(os::ArgumentType::ACL_STATUS_CODE, static_cast<int>(status)));

    bluetooth::os::LogMetricBluetoothLEConnectionMetricEvent(
        address,
        android::bluetooth::le::LeConnectionOriginType::ORIGIN_NATIVE,
        android::bluetooth::le::LeConnectionType::CONNECTION_TYPE_LE_ACL,
        android::bluetooth::le::LeConnectionState::STATE_LE_ACL_END,
        argument_list);

    if (role == hci::Role::CENTRAL) {
      connectability_state_ = ConnectabilityState::DISARMED;
@@ -1003,15 +982,6 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
  }

  void disarm_connectability() {

    auto argument_list = std::vector<std::pair<os::ArgumentType, int>>();
    bluetooth::os::LogMetricBluetoothLEConnectionMetricEvent(
        Address::kEmpty,
        os::LeConnectionOriginType::ORIGIN_UNSPECIFIED,
        os::LeConnectionType::CONNECTION_TYPE_LE_ACL,
        os::LeConnectionState::STATE_LE_ACL_CANCEL,
        argument_list);

    switch (connectability_state_) {
      case ConnectabilityState::ARMED:
        LOG_INFO("Disarming LE connection state machine with create connection cancel");
@@ -1108,17 +1078,6 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
    if (create_connection_timeout_alarms_.find(address_with_type) != create_connection_timeout_alarms_.end()) {
      create_connection_timeout_alarms_.at(address_with_type).Cancel();
      create_connection_timeout_alarms_.erase(address_with_type);
      auto argument_list = std::vector<std::pair<os::ArgumentType, int>>();
      argument_list.push_back(std::make_pair(
          os::ArgumentType::ACL_STATUS_CODE,
          static_cast<int>(android::bluetooth::hci::StatusEnum::STATUS_CONNECTION_TOUT)));
      bluetooth::os::LogMetricBluetoothLEConnectionMetricEvent(
          address_with_type.GetAddress(),
          android::bluetooth::le::LeConnectionOriginType::ORIGIN_NATIVE,
          android::bluetooth::le::LeConnectionType::CONNECTION_TYPE_LE_ACL,
          android::bluetooth::le::LeConnectionState::STATE_LE_ACL_TIMEOUT,
          argument_list);

      if (background_connections_.find(address_with_type) != background_connections_.end()) {
        direct_connections_.erase(address_with_type);
        disarm_connectability();
+0 −3
Original line number Diff line number Diff line
@@ -11,8 +11,6 @@ filegroup {
    name: "BluetoothMetricsSources",
    srcs: [
        "counter_metrics.cc",
        "metrics_state.cc",
        "utils.cc"
    ],
}

@@ -20,6 +18,5 @@ filegroup {
    name: "BluetoothMetricsTestSources",
    srcs: [
        "counter_metrics_unittest.cc",
        "metrics_state_unittest.cc"
    ],
}
Loading