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

Commit 89de6824 authored by Vaibhav Devmurari's avatar Vaibhav Devmurari
Browse files

Fix: Concurrent modification exception in sensor manager

Bug: 417901348
Flag: EXEMPT bugfix
Test: Presubmits
Change-Id: Ibb6cd2922b8865439a419d3f33e266528be88c29
parent e456a4ff
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -280,13 +280,11 @@ public class InputDeviceSensorManager {
                mSensorEvents.clear();
                return;
            }
            for (Sensor s : mSensors) {
                if (sensorEquals(s, sensor)) {
                    mSensors.remove(sensor);
            boolean removed = mSensors.removeIf(s -> sensorEquals(s, sensor));
            if (removed) {
                mSensorEvents.remove(sensor.getType());
            }
        }
        }

        /**
         * Add a sensor to listener's sensor list