summaryrefslogtreecommitdiff
path: root/system/common/metrics.cc
diff options
context:
space:
mode:
author Palash Ahuja <ahujapalash@google.com> 2023-03-23 02:30:09 +0000
committer Palash Ahuja <ahujapalash@google.com> 2023-03-22 19:39:55 -0700
commitfc41a25bad034ea910775e32650cbc085ac8b562 (patch)
tree776ad0ef8f3b6959bb1ad9bc3997506adf1d22bf /system/common/metrics.cc
parent5a00b850b0ebdb337effb97564d46d8ee497f307 (diff)
Revert "Revert "[BluetoothMetrics] This covers the case for Direct LE-AC...""
This reverts commit 5a00b850b0ebdb337effb97564d46d8ee497f307. Reason for revert: Adding the fix for the floss build Change-Id: Ia02811feed9403643dc8d415903bfeea229c0ebb
Diffstat (limited to 'system/common/metrics.cc')
-rw-r--r--system/common/metrics.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/system/common/metrics.cc b/system/common/metrics.cc
index baf838b0c4..b243fd78b7 100644
--- a/system/common/metrics.cc
+++ b/system/common/metrics.cc
@@ -20,6 +20,7 @@
#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>
@@ -35,6 +36,9 @@
#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"
@@ -68,6 +72,7 @@ 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) {
@@ -969,6 +974,19 @@ 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