OSDN Git Service

Metrics: Add metrics item for profile usage
authorJack He <siyuanh@google.com>
Mon, 2 Apr 2018 20:04:58 +0000 (13:04 -0700)
committerJack He <siyuanh@google.com>
Wed, 11 Apr 2018 21:55:05 +0000 (21:55 +0000)
commit8bc22a1698b77a93eb6f53a9220f61a53775ee9b
treed6c47efe3a13f5969285328fce03a42d325f3b86
parent0b8d48dfbdf339947022db780e096096d3527bdd
Metrics: Add metrics item for profile usage

Item A: Add messages to log profile connections
* Add ProfileUsageStats message in bluetooth.proto
* Add BluetoothProfileId enum to represent each profile
* Add num_times_connected item to log how many times a profile is
  connected

Item B: Add messages to log headset profile connections for HSP and HFP
* Add HeadsetProfileConnectionStats message in bluetooth.proto
* Add HeadsetProfileType enum to represent each headset profile type
* Add num_times_connected item to log how many times each headset
  profile is connected

* Add unit tests in metrics_tests
* Remove "clear" flag in various metrics dumping methods to make sure
  that we clean up metrics every time we dump

Bug: 77476285
Test: make, net_test_osi, BtFunhausMetricsTest,
      adb shell dumpsys bluetooth_manager --proto-bin
Change-Id: Ib18948c50ddb98ab7472f7b51a9bb98d153071c7
Merged-In: Ib18948c50ddb98ab7472f7b51a9bb98d153071c7
btif/src/bluetooth.cc
btif/src/btif_hf.cc
osi/include/metrics.h
osi/src/metrics.cc
osi/test/metrics_test.cc
proto/bluetooth/metrics/bluetooth.proto