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

Commit 8b2746bf authored by Antoan Angelov's avatar Antoan Angelov
Browse files

Revert "Metric: Add logging for link layer connection events"

This reverts commit 1bdac04d.

Reason for revert: Breaking one of our targets.

Change-Id: Id621586276c934312b9ea38e8420ac4a46cb88a0
parent 1bdac04d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -62,10 +62,8 @@ fluoride_defaults {
    },
    defaults: ["fluoride_types_defaults"],
    header_libs: ["libbluetooth_headers"],
    shared_libs: ["libstatslog"],
    static_libs: [
        "libbluetooth-types",
        "libbt-platform-protos-lite",
    ],
    cpp_std: "c++17",
    sanitize: {
+0 −30
Original line number Diff line number Diff line
@@ -29,13 +29,11 @@
#include <base/base64.h>
#include <base/logging.h>
#include <include/hardware/bt_av.h>
#include <statslog.h>

#include "bluetooth/metrics/bluetooth.pb.h"
#include "osi/include/osi.h"
#include "stack/include/btm_api_types.h"

#include "address_obfuscator.h"
#include "leaky_bonded_queue.h"
#include "metrics.h"
#include "time_util.h"
@@ -569,34 +567,6 @@ void BluetoothMetricsLogger::Reset() {
  pimpl_->scan_event_queue_->Clear();
}

void LogLinkLayerConnectionEvent(const RawAddress* address,
                                 uint32_t connection_handle,
                                 android::bluetooth::DirectionEnum direction,
                                 uint32_t link_type, uint32_t hci_cmd,
                                 uint32_t hci_event, uint32_t hci_ble_event,
                                 uint32_t cmd_status, uint32_t reason_code) {
  std::string obfuscated_id;
  if (address != nullptr) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(*address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  android::util::BytesField bytes_field(
      address != nullptr ? obfuscated_id.c_str() : nullptr,
      address != nullptr ? obfuscated_id.size() : 0);
  int ret = android::util::stats_write(
      android::util::BLUETOOTH_LINK_LAYER_CONNECTION_EVENT, bytes_field,
      connection_handle, direction, link_type, hci_cmd, hci_event,
      hci_ble_event, cmd_status, reason_code);
  if (ret < 0) {
    LOG(WARNING) << __func__ << ": failed to log status 0x"
                 << loghex(cmd_status) << ", reason 0x" << loghex(reason_code)
                 << " from cmd 0x" << loghex(hci_cmd) << ", event 0x"
                 << loghex(hci_event) << ", ble_event 0x"
                 << loghex(hci_ble_event) << " for " << address << ", handle "
                 << connection_handle << ", error " << ret;
  }
}

}  // namespace common

}  // namespace bluetooth
+0 −28
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@
#pragma once

#include <bta/include/bta_api.h>
#include <frameworks/base/core/proto/android/bluetooth/enums.pb.h>
#include <stdint.h>
#include <memory>
#include <string>
@@ -277,33 +276,6 @@ class BluetoothMetricsLogger {
  std::unique_ptr<impl> const pimpl_;
};

/**
 * Unknown connection handle for metrics purpose
 */
static const uint32_t kUnknownConnectionHandle = 0xFFFF;

/**
 * Log link layer connection event
 *
 * @param address Stack wide consistent Bluetooth address of this event,
 *                nullptr if unknown
 * @param connection_handle connection handle of this event,
 *                          {@link kUnknownConnectionHandle} if unknown
 * @param direction direction of this connection
 * @param link_type type of the link
 * @param hci_cmd HCI command opecode associated with this event, if any
 * @param hci_event HCI event code associated with this event, if any
 * @param hci_ble_event HCI BLE event code associated with this event, if any
 * @param cmd_status Command status associated with this event, if any
 * @param reason_code Reason code associated with this event, if any
 */
void LogLinkLayerConnectionEvent(const RawAddress* address,
                                 uint32_t connection_handle,
                                 android::bluetooth::DirectionEnum direction,
                                 uint32_t link_type, uint32_t hci_cmd,
                                 uint32_t hci_event, uint32_t hci_ble_event,
                                 uint32_t cmd_status, uint32_t reason_code);

}  // namespace common

}  // namespace bluetooth
+0 −1
Original line number Diff line number Diff line
@@ -115,7 +115,6 @@ cc_test {
        "liblog",
        "libprotobuf-cpp-lite",
        "libcutils",
        "libcrypto",
    ],
    static_libs: [
        "libbt-common",
+0 −1
Original line number Diff line number Diff line
@@ -267,7 +267,6 @@ cc_test {
    shared_libs: [
        "libcutils",
        "libprotobuf-cpp-lite",
        "libcrypto",
    ],
    static_libs: [
        "liblog",
Loading