Loading apex/jobscheduler/service/aconfig/job.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -29,16 +29,6 @@ flag { bug: "299329948" } flag { name: "count_quota_fix" namespace: "backstage_power" description: "Fix job count quota check" bug: "300862949" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "thermal_restrictions_to_fgs_jobs" namespace: "backstage_power" Loading apex/jobscheduler/service/java/com/android/server/job/JobConcurrencyManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -1652,7 +1652,7 @@ class JobConcurrencyManager { continue; } if (Flags.countQuotaFix() && !nextPending.isReady()) { if (!nextPending.isReady()) { // This could happen when the constraints for the job have been marked // as unsatisfiled but hasn't been removed from the pending queue yet. if (DEBUG) { Loading Loading @@ -1749,7 +1749,7 @@ class JobConcurrencyManager { continue; } if (Flags.countQuotaFix() && !nextPending.isReady()) { if (!nextPending.isReady()) { // This could happen when the constraints for the job have been marked // as unsatisfiled but hasn't been removed from the pending queue yet. if (DEBUG) { Loading apex/jobscheduler/service/java/com/android/server/job/controllers/QuotaController.java +6 −18 Original line number Diff line number Diff line Loading @@ -953,14 +953,6 @@ public final class QuotaController extends StateController { // 1. it was started while the app was in the TOP state // 2. the app is currently in the foreground // 3. the app overall is within its quota if (!Flags.countQuotaFix()) { return jobStatus.shouldTreatAsUserInitiatedJob() || isTopStartedJobLocked(jobStatus) || isUidInForeground(jobStatus.getSourceUid()) || isWithinQuotaLocked( jobStatus.getSourceUserId(), jobStatus.getSourcePackageName(), standbyBucket); } if (jobStatus.shouldTreatAsUserInitiatedJob() || isTopStartedJobLocked(jobStatus) || isUidInForeground(jobStatus.getSourceUid())) { Loading Loading @@ -1531,11 +1523,9 @@ public final class QuotaController extends StateController { stats.jobCountInRateLimitingWindow = 0; } stats.jobCountInRateLimitingWindow += count; if (Flags.countQuotaFix()) { stats.bgJobCountInWindow += count; } } } private boolean isCompatOverridedForQuotaConstantAdjustment() { return mPlatformCompat.isChangeEnabledByPackageName( Loading Loading @@ -1774,7 +1764,7 @@ public final class QuotaController extends StateController { } } else if (realStandbyBucket != EXEMPTED_INDEX && realStandbyBucket != ACTIVE_INDEX && realStandbyBucket == js.getEffectiveStandbyBucket() && !(Flags.countQuotaFix() && mService.isCurrentlyRunningLocked(js))) { && !mService.isCurrentlyRunningLocked(js)) { // An app in the ACTIVE bucket may be out of quota while the job could be in quota // for some reason. Therefore, avoid setting the real value here and check each job // individually. Running job need to determine its own quota status as well. Loading Loading @@ -2195,14 +2185,12 @@ public final class QuotaController extends StateController { mBgJobCount++; if (mRegularJobTimer) { incrementJobCountLocked(mPkg.userId, mPkg.packageName, 1); if (Flags.countQuotaFix()) { final ExecutionStats stats = getExecutionStatsLocked(mPkg.userId, mPkg.packageName, jobStatus.getEffectiveStandbyBucket(), false); if (!isUnderJobCountQuotaLocked(stats)) { mHandler.obtainMessage(MSG_REACHED_COUNT_QUOTA, mPkg).sendToTarget(); } } } if (mRunningBgJobs.size() == 1) { // Started tracking the first job. mStartTimeElapsed = sElapsedRealtimeClock.millis(); Loading services/tests/mockingservicestests/src/com/android/server/job/controllers/QuotaControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock; import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.when; import static com.android.server.job.Flags.FLAG_COUNT_QUOTA_FIX; import static com.android.server.job.JobSchedulerService.ACTIVE_INDEX; import static com.android.server.job.JobSchedulerService.EXEMPTED_INDEX; import static com.android.server.job.JobSchedulerService.FREQUENT_INDEX; Loading Loading @@ -3292,7 +3291,6 @@ public class QuotaControllerTest { } @Test @RequiresFlagsEnabled(FLAG_COUNT_QUOTA_FIX) public void testIsWithinQuotaLocked_UnderDuration_OverJobCountInWindow() { setDischarging(); Loading Loading
apex/jobscheduler/service/aconfig/job.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -29,16 +29,6 @@ flag { bug: "299329948" } flag { name: "count_quota_fix" namespace: "backstage_power" description: "Fix job count quota check" bug: "300862949" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "thermal_restrictions_to_fgs_jobs" namespace: "backstage_power" Loading
apex/jobscheduler/service/java/com/android/server/job/JobConcurrencyManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -1652,7 +1652,7 @@ class JobConcurrencyManager { continue; } if (Flags.countQuotaFix() && !nextPending.isReady()) { if (!nextPending.isReady()) { // This could happen when the constraints for the job have been marked // as unsatisfiled but hasn't been removed from the pending queue yet. if (DEBUG) { Loading Loading @@ -1749,7 +1749,7 @@ class JobConcurrencyManager { continue; } if (Flags.countQuotaFix() && !nextPending.isReady()) { if (!nextPending.isReady()) { // This could happen when the constraints for the job have been marked // as unsatisfiled but hasn't been removed from the pending queue yet. if (DEBUG) { Loading
apex/jobscheduler/service/java/com/android/server/job/controllers/QuotaController.java +6 −18 Original line number Diff line number Diff line Loading @@ -953,14 +953,6 @@ public final class QuotaController extends StateController { // 1. it was started while the app was in the TOP state // 2. the app is currently in the foreground // 3. the app overall is within its quota if (!Flags.countQuotaFix()) { return jobStatus.shouldTreatAsUserInitiatedJob() || isTopStartedJobLocked(jobStatus) || isUidInForeground(jobStatus.getSourceUid()) || isWithinQuotaLocked( jobStatus.getSourceUserId(), jobStatus.getSourcePackageName(), standbyBucket); } if (jobStatus.shouldTreatAsUserInitiatedJob() || isTopStartedJobLocked(jobStatus) || isUidInForeground(jobStatus.getSourceUid())) { Loading Loading @@ -1531,11 +1523,9 @@ public final class QuotaController extends StateController { stats.jobCountInRateLimitingWindow = 0; } stats.jobCountInRateLimitingWindow += count; if (Flags.countQuotaFix()) { stats.bgJobCountInWindow += count; } } } private boolean isCompatOverridedForQuotaConstantAdjustment() { return mPlatformCompat.isChangeEnabledByPackageName( Loading Loading @@ -1774,7 +1764,7 @@ public final class QuotaController extends StateController { } } else if (realStandbyBucket != EXEMPTED_INDEX && realStandbyBucket != ACTIVE_INDEX && realStandbyBucket == js.getEffectiveStandbyBucket() && !(Flags.countQuotaFix() && mService.isCurrentlyRunningLocked(js))) { && !mService.isCurrentlyRunningLocked(js)) { // An app in the ACTIVE bucket may be out of quota while the job could be in quota // for some reason. Therefore, avoid setting the real value here and check each job // individually. Running job need to determine its own quota status as well. Loading Loading @@ -2195,14 +2185,12 @@ public final class QuotaController extends StateController { mBgJobCount++; if (mRegularJobTimer) { incrementJobCountLocked(mPkg.userId, mPkg.packageName, 1); if (Flags.countQuotaFix()) { final ExecutionStats stats = getExecutionStatsLocked(mPkg.userId, mPkg.packageName, jobStatus.getEffectiveStandbyBucket(), false); if (!isUnderJobCountQuotaLocked(stats)) { mHandler.obtainMessage(MSG_REACHED_COUNT_QUOTA, mPkg).sendToTarget(); } } } if (mRunningBgJobs.size() == 1) { // Started tracking the first job. mStartTimeElapsed = sElapsedRealtimeClock.millis(); Loading
services/tests/mockingservicestests/src/com/android/server/job/controllers/QuotaControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock; import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.when; import static com.android.server.job.Flags.FLAG_COUNT_QUOTA_FIX; import static com.android.server.job.JobSchedulerService.ACTIVE_INDEX; import static com.android.server.job.JobSchedulerService.EXEMPTED_INDEX; import static com.android.server.job.JobSchedulerService.FREQUENT_INDEX; Loading Loading @@ -3292,7 +3291,6 @@ public class QuotaControllerTest { } @Test @RequiresFlagsEnabled(FLAG_COUNT_QUOTA_FIX) public void testIsWithinQuotaLocked_UnderDuration_OverJobCountInWindow() { setDischarging(); Loading