Adding metrics to alarm manager

Push atoms:
 - Every time an alarm is scheduled, we push some attributes of the
 alarm and the reason why such an alarm was allowed. This will help
 audit spammy behavior from apps that misuse alarm API, e.g.
 apps that have SCHEDULE_EXACT_ALARM.
 - Every time an alarm batch is delivered, we log the size of the batch
 and whether or not it was a wakeup batch. This is the essential measure
 of alarm manager's batching efficiency.

Pulled atoms:
 - Logging general stats on pending alarms every once in a while.

Test: atest CtsAlarmManagerTestCases
atest FrameworksMockingServicesTests:com.android.server.alarm

statsd-testdrive 377 378 10106

Bug: 161497385
Bug: 171306433
Bug: 177556103
Change-Id: Ib13c9c380b641d318c6b8777996aa37f9b3d1bfc
10 files changed