Implement LongRebootBlockingReported metric
Adds a new BlockingEntityRecord class which tracks a
component or app uid which is blocking the reboot. If a
given component/app block the reboot for a time greater than
a given threshold (default is one hour), this will be logged
to statsd with a LongRebootBlockingReported atom. This atom
may be logged multiple times if the entity continues to
block the reboot for multiple thresholds. The threshold
is configurable via DeviceConfig.
Maps of blocking components/apps are stored in RebootReadinessLogger. If
a previously blocking app/component is no longer blocking the
reboot, it will be pruned from the map.
Test: Manual. Configure DeviceConfig and test with a blocking
app and component and a threshold of 10 seconds. Note that
the correct data is written to logcat when the reboot has been
blocked for 10 seconds.
Bug: 183587376
Change-Id: Ic4769968d3dfe5a2e7cf2e49632d6551bcd98404
2 files changed