Skip tracking adjustments when there's no change.
Avoid incrementing the bg job count and other timer tracking adjustments if the job is already being tracked. Bug: 205295122 Test: atest --rerun-until-failure 25 FrameworksMockingServicesTests:QuotaControllerTest Change-Id: I2b9690c95d3ea31ef37a5631fa8322e925da511c
This commit is contained in:
@@ -2010,9 +2010,8 @@ public final class QuotaController extends StateController {
|
||||
if (DEBUG) {
|
||||
Slog.v(TAG, "Starting to track " + jobStatus.toShortString());
|
||||
}
|
||||
// Always track jobs, even when charging.
|
||||
mRunningBgJobs.add(jobStatus);
|
||||
if (shouldTrackLocked()) {
|
||||
// Always maintain list of running jobs, even when quota is free.
|
||||
if (mRunningBgJobs.add(jobStatus) && shouldTrackLocked()) {
|
||||
mBgJobCount++;
|
||||
if (mRegularJobTimer) {
|
||||
incrementJobCountLocked(mPkg.userId, mPkg.packageName, 1);
|
||||
|
||||
Reference in New Issue
Block a user