Log broadcast dispatch latency during BOOT_COMPLETED

From device boot until BOOT_COMPLETED, log the dispatch latency of a
broadcast, which is the duration between it being enqueued and it being
dispatched, to get an idea of how long the queue is blocked for.

Each time a broadcast is dispatched, we check mLogLatencyMetrics, which
defaults to true when the queue is initialized, and log to statsd.

When the queue is empty, we check if BOOT_COMPLETED is done. If it is,
we stop logging by setting mLogLatencyMetrics to false, since it means
that we have finished all broadcasts that
would have been blocked by BOOT_COMPLETED.

Bug: 120794810
Test: flash, reboot, use stasd_testdrive to verify logging
Change-Id: I40c14744e5247412c0a03032fd5621706758a324
3 files changed