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

Commit 93af243a authored by Chen Chen's avatar Chen Chen
Browse files

BluetoothMetrics: Add counter metrics in GD cpp

1) Provide API CounterMetrics.Count() to other
bt components
2) Cache the counters
3) Send the counters to westworld every 6 hours and
before Bluetooth is closed

Bug: 204823249
Tag: #feature
Test: atest bluetooth_test_gd_unit
Change-Id: I9cd6ac9e79bfe5d378c13caa3fd2a76a27c1e025
parent ec296799
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -181,6 +181,7 @@ cc_defaults {
        ":BluetoothHciSources",
        ":BluetoothIsoSources",
        ":BluetoothL2capSources",
        ":BluetoothMetricsSources",
        ":BluetoothNeighborSources",
        ":BluetoothPacketSources",
        ":BluetoothShimSources",
@@ -353,6 +354,7 @@ cc_test {
        ":BluetoothHalTestSources",
        ":BluetoothHciUnitTestSources",
        ":BluetoothL2capUnitTestSources",
        ":BluetoothMetricsTestSources",
        ":BluetoothPacketTestSources",
        ":BluetoothShimTestSources",
        ":BluetoothSecurityUnitTestSources",
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ static_library("libbluetooth_gd") {
    "//bt/system/gd/hal:BluetoothHalSources",
    "//bt/system/gd/hal:BluetoothHalSources_hci_host",
    "//bt/system/gd/l2cap:BluetoothL2capSources",
    "//bt/system/gd/metrics:BluetoothMetricsSources",
    "//bt/system/gd/neighbor:BluetoothNeighborSources",
    "//bt/system/gd/security:BluetoothSecuritySources",
    "//bt/system/gd/shim:BluetoothShimSources",
+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@

#include "hal/hci_hal.h"
#include "hal/snoop_logger.h"
#include "metrics/counter_metrics.h"
#include "os/log.h"
#include "os/reactor.h"
#include "os/thread.h"
@@ -262,6 +263,7 @@ class HciHalHost : public HciHal {

 protected:
  void ListDependencies(ModuleList* list) const {
    list->add<metrics::CounterMetrics>();
    list->add<SnoopLogger>();
  }

+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@

#include "hal/hci_hal.h"
#include "hal/snoop_logger.h"
#include "metrics/counter_metrics.h"
#include "os/log.h"
#include "os/reactor.h"
#include "os/thread.h"
@@ -157,6 +158,7 @@ class HciHalHost : public HciHal {

 protected:
  void ListDependencies(ModuleList* list) const {
    list->add<metrics::CounterMetrics>();
    list->add<SnoopLogger>();
  }

+22 −0
Original line number Diff line number Diff line
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "system_bt_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["system_bt_license"],
}

filegroup {
    name: "BluetoothMetricsSources",
    srcs: [
        "counter_metrics.cc",
    ],
}

filegroup {
    name: "BluetoothMetricsTestSources",
    srcs: [
        "counter_metrics_unittest.cc",
    ],
}
Loading