Make sure RESTRICTED quota is properly counted.

Make sure that quota is counted properly for RESTRICTED jobs when the
device is charging but not idle.

Also add some GuardedBy annotations and update some method names. It's
not exhaustive, but a start.

Bug: 141645789
Bug: 187189316
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
Test: atest CtsJobSchedulerTestCases
Change-Id: I75fae5e3ae71435367db7dd9fa2c14f5d1029a67
1 file changed