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

Commit 2af2a8c3 authored by Abhishek Gadewar's avatar Abhishek Gadewar
Browse files

ThermalManager: Don't hold mSamples lock while calling power HAL



Summary: There is no need to hold the lock while making the call to the power
HAL. In the case the HAL call takes a long time due to hardware reads,
holding the lock may cause lock contention from other threads.

Test: build passes

Tags:
Change-Id: I6b1f8d1228de17e4bf188bd99037b02ac7ebff1a
Signed-off-by: default avatarAbhishek Gadewar <abhishekgadewar@meta.com>
parent b90b46a5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1591,9 +1591,9 @@ public class ThermalManagerService extends SystemService {
        long mInactivityThresholdMillis = INACTIVITY_THRESHOLD_MILLIS;

        void updateThresholds() {
            synchronized (mSamples) {
            List<TemperatureThreshold> thresholds =
                        mHalWrapper.getTemperatureThresholds(true, Temperature.TYPE_SKIN);
            synchronized (mSamples) {
                if (Flags.allowThermalHeadroomThresholds()) {
                    Arrays.fill(mHeadroomThresholds, Float.NaN);
                }