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

Commit 5771743a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Increase thermal threshold for all UI jobs." into udc-dev am: 6f12ef23

parents f6c710b3 6f12ef23
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);