OSDN Git Service

Corrected default value assignments in Bluetooth A2DP Metrics
authorJack He <siyuanh@google.com>
Fri, 20 Jan 2017 19:17:44 +0000 (11:17 -0800)
committerJack He <siyuanh@google.com>
Mon, 23 Jan 2017 23:52:44 +0000 (15:52 -0800)
commit5a9925784a4a34811ae29608b67dee4a580c226b
tree2ec2e87c0434c65f2b401fa9d9693f6683d5f0e8
parent7ab4b59672013eddcb706e288962ab7309a75628
Corrected default value assignments in Bluetooth A2DP Metrics

* In certain cases btif_media_task_stop_aa_req() could be called before
  btif_media_task_start_aa_req() is called, resulting in session_start_us
  to be 0. In this case, audio_duration_ms = time_now_us() - 0 will be a
  very large number that is not the actual audio duration.This CL marks
  audio_duration_ms as -1 in the above situation so that we can
  differentiate between valid and invalid audio durations
* Set default timer and counter values to 0 when
  tx_queue_dequeue_stats.total_updates > 1
* Move update_scheduling_stats for tx_queue_enqueue_stats to
  btif_media_task_aa_handle_timer as we intend to capture the time
  intervals for enqueue scheduling instead of time intervals between
  frame enqueue (i.e. one scheduling event can enqueue multiple frames)
* Use tx_queue_enqueue_stats instead of *dequeue* since only enqueue is
  triggered by timer event

Bug: 33694310
Test: Code compilation, BtFunhausMetricsTest
Change-Id: I10984920afd4d77f07a5ac75736f8dcd69b13af8
btif/src/btif_media_task.c
osi/src/metrics.cpp