Store time until next interaction metric

If the device rebooted while it was ready to reboot, the time
until next interaction will be the time between the device
becoming ready to reboot, and the first USER_PRESENT broadcast
sent after the reboot.

If it reboots while the device is not ready to reboot (i.e. organically),
then the logged value is the time between the device becoming ready to
reboot and not ready to reboot. This value is persisted in a file
during the previous boot.

Also adds logic to delete logging information if reboot readiness
checks are cancelled while the device is ready to reboot.

Test: atest RebootReadinessUnitTests
Test: Manual: inspect reboot-stats.xml
Test: Manual: reboot in both reboot readiness states, and verify
      the UnattendedRebootOccurred atom that is logged
Bug: 192056476
Change-Id: Ic0febc8ea561736e80616c6ef564b069f7fe34f4
9 files changed
tree: 0885b8c2e0f316dc83036c0cf16d6219d2129ee0
  1. apex/
  2. framework/
  3. service/
  4. tests/
  5. OWNERS
  6. PREUPLOAD.cfg