Add grace period to estimated launch times.

With user variance, estimated launch times could sometimes be a few
minutes early. If the estimate is a few minutes early, we decide to
stop running a prefetch job even if the app ends up being launched
soon afterwards. This adds a short grace period to estimated launch
times when determining if a prefetch job should be allowed to run
in order to avoid penalizing early estimates too much.

Bug: 232418832
Test: atest FrameworksMockingServicesTests:PrefetchControllerTest
Change-Id: I07fa95603fbc34d10f5919a6d2d702a73653a401
2 files changed