Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f12ef23 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Increase thermal threshold for all UI jobs." into udc-dev

parents 6073614a a16e3f81
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -92,13 +92,17 @@ public class ThermalStatusRestriction extends JobRestriction {
        final int priority = job.getEffectivePriority();
        if (mThermalStatus >= HIGHER_PRIORITY_THRESHOLD) {
            // For moderate throttling:
            // Only let expedited & user-initiated jobs run if:
            // Let all user-initiated jobs run.
            // Only let expedited jobs run if:
            // 1. They haven't previously run
            // 2. They're already running and aren't yet in overtime
            // Only let high priority jobs run if:
            //   They are already running and aren't yet in overtime
            // Don't let any other job run.
            if (job.shouldTreatAsExpeditedJob() || job.shouldTreatAsUserInitiatedJob()) {
            if (job.shouldTreatAsUserInitiatedJob()) {
                return false;
            }
            if (job.shouldTreatAsExpeditedJob()) {
                return job.getNumPreviousAttempts() > 0
                        || (mService.isCurrentlyRunningLocked(job)
                                && mService.isJobInOvertimeLocked(job));
+2 −2
Original line number Diff line number Diff line
@@ -276,9 +276,9 @@ public class ThermalStatusRestrictionTest {
        assertFalse(mThermalStatusRestriction.isJobRestricted(ejRunning));
        assertTrue(mThermalStatusRestriction.isJobRestricted(ejRunningLong));
        assertFalse(mThermalStatusRestriction.isJobRestricted(ui));
        assertTrue(mThermalStatusRestriction.isJobRestricted(uiRetried));
        assertFalse(mThermalStatusRestriction.isJobRestricted(uiRetried));
        assertFalse(mThermalStatusRestriction.isJobRestricted(uiRunning));
        assertTrue(mThermalStatusRestriction.isJobRestricted(uiRunningLong));
        assertFalse(mThermalStatusRestriction.isJobRestricted(uiRunningLong));

        mStatusChangedListener.onThermalStatusChanged(THERMAL_STATUS_SEVERE);