summaryrefslogtreecommitdiff
path: root/system/common/metrics.cc
diff options
context:
space:
mode:
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