OSDN Git Service

Multi-A2DP: Fix timing and codec measurement in metrics
authorJack He <siyuanh@google.com>
Sat, 9 Jun 2018 03:13:23 +0000 (20:13 -0700)
committerJack He <siyuanh@google.com>
Thu, 14 Jun 2018 21:05:14 +0000 (14:05 -0700)
commitfeeaf5f8cf31394d6f737543f1d0572ca91d487c
tree8d519e53c3fb8cfda7b952ec1072cb9ca112cd5f
parent36b5cfd8a8144c32068c0a0e60e8bfe079d4ab83
Multi-A2DP: Fix timing and codec measurement in metrics

* Copy BtifMediaStats and SchedulingStats when updating metrics
  to avoid race conditions
* Do not log audio_duration_ms if session_end_us <= session_start_us
* Clear cached A2DP metrics when LogBluetoothSessionEnd() is called
* Log codec information along-side A2DP metrics
* Log whether A2DP offload is enabled along-side A2DP metrics

Multi-A2DP:
* Log LogBluetoothSessionStart at btif_a2dp_source_start_session_delayed
* Log LogBluetoothSessionEnd at btif_a2dp_source_end_session_delayed

Unit Test:
* Wrote A2DPSessionTwoUpdatesSeparatedbyEndTest that will fail if A2DP
  metrics are not cleared when LogBluetoothSessionEnd is called

Bug: 109953464
Test: make, net_test_osi::BluetoothMetricsLoggerTest,
      net_test_osi::BluetoothA2DPSessionMetricsTest
Change-Id: I6a311dce8035ce2e3f39773c260ea9eaef73e45b
btif/src/btif_a2dp_source.cc
osi/include/metrics.h
osi/src/metrics.cc
osi/test/metrics_test.cc
proto/bluetooth/metrics/bluetooth.proto