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

Commit eda19967 authored by PODISHETTY KUMAR's avatar PODISHETTY KUMAR Committed by Android (Google) Code Review
Browse files

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

This reverts commit 436e7d8b.

Reason for revert: <Dorid monitor: Likely culprit for b/346904307  - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.>

Change-Id: Ife94d7148df3d47634c97564f81171059c82df04
parent 436e7d8b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1709,7 +1709,7 @@ public class ThermalManagerService extends SystemService {
                    ArrayList<Sample> samples = mSamples.computeIfAbsent(temperature.getName(),
                            k -> new ArrayList<>(RING_BUFFER_SIZE));
                    if (samples.size() == RING_BUFFER_SIZE) {
                        samples.removeFirst();
                        samples.remove(0);
                    }
                    samples.add(new Sample(now, temperature.getValue()));
                }
@@ -1806,7 +1806,7 @@ public class ThermalManagerService extends SystemService {
                        continue;
                    }

                    float currentTemperature = samples.getLast().temperature;
                    float currentTemperature = samples.get(0).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(watcher.createSampleForTesting(1000 * i, 25.0f + 0.5f * i));
            samples.add(0, watcher.createSampleForTesting(1000 * i, 25.0f + 0.5f * i));
        }

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