CTS validation: duration metric wakelock tests

Creates a config for wakelock duration per uid per tag while screen off
and on battery. Implements two tests using this metric:
the first gets a wakelock for 500ms. It looks at all wakelocks received
by statsd and batterystats and makes sure both are reasonable (for all uids).
It also makes sure the desired wakelock is present and accurate in both.

The second spawns 16 threads, each of which acquire and release 1000
wakelocks, waiting 700us between each. The goal of this test is to trigger
the condition where logd drops an event with high probability,
without simply spamming the buffer. In this test, I got a stuck wakelock
10/10 times.

Test: this test
Bug: 77157963
Bug: 77249503
Bug: 77499580
Change-Id: Ic69abc2ff0b8c4565cf3b63cb542817c19c5f2b4
3 files changed