Fix StorageController bugs.

1. StorageController was taking the return value of
setStorageNotLowConstraintSatisfied to be the previous value of the
constraint before the change. However, the return value indicates whether
or not the constraint changed. This meant that StorageController would
sometimes notify JobSchedulerService when a constraint hadn't actually
changed and would sometimes not notify JobSchedulerService when a
constraint had changed.

2. The calls to onRunJobNow and onControllerStateChanged both result in
JobSchedulerService iterating through the JobStore to identify jobs to
run. Calling both of them provides no benefit.

3. StorageController was listening for the STORAGE_LOW intent but wasn't
actually updating job statuses so jobs would continue to run after the
storage became low.

Bug: 125531072
Test: atest android.jobscheduler.cts.StorageConstraintTest
Change-Id: I10fa9bae3bdbd2545c15e5cab647a0820b9fbfa7
1 file changed