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

Commit 0a4add42 authored by Xiang Wang's avatar Xiang Wang
Browse files

Revert^2 "Use the latest temperature read as base for headroom calculation"

This reverts commit eda19967.

Reason for revert: reland with a version not using JDK21 methods

Bug: 346425206
Change-Id: I4cddc1936ee684091f430c294d6c829d7cfd3ba2
Merged-In: I706933e7f4bbd1b9abd6591255a605d7643ad7ee
parent eda19967
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1806,7 +1806,7 @@ public class ThermalManagerService extends SystemService {
                        continue;
                    }

                    float currentTemperature = samples.get(0).temperature;
                    float currentTemperature = samples.get(samples.size() - 1).temperature;

                    if (samples.size() < MINIMUM_SAMPLE_COUNT) {
                        // Don't try to forecast, just use the latest one we have
+1 −1
Original line number Diff line number Diff line
@@ -551,7 +551,7 @@ public class ThermalManagerServiceTest {

        // Add some time-series data
        for (int i = 1; i < 20; ++i) {
            samples.add(0, watcher.createSampleForTesting(1000 * i, 25.0f + 0.5f * i));
            samples.add(watcher.createSampleForTesting(1000 * i, 25.0f + 0.5f * i));
        }

        // Now the forecast should vary depending on how far ahead we are trying to predict