Fix ACTIVE/EXEMPT quota calculation.

We were incorrectly saying that jobs in the ACTIVE + EXEMPTED buckets
(where bucket window size = allowed time) didn't have any extra time
until the quota was consumed even though they were still under the max
execution limit. Changing to make sure we don't return the incorrect
value.

Also, rescheduling the timer cutoff when the lowest priority of tracked
jobs changes.

Bug: 218216817
Test: atest FrameworksMockingServicesTests:QuotaControllerTest
Change-Id: I98fb3466ca65a102f973c4f588d47c1f1b26ad6e
2 files changed