From fc4ede0bd96d63857dae53272a18ac1062634f35 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Sat, 1 Apr 2023 23:54:21 +0200 Subject: [PATCH] proximity: clear listeners on stop This change does not really have an effect, but it is cleaner. --- app/src/main/kotlin/d/d/meshenger/call/RTCProximitySensor.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/d/d/meshenger/call/RTCProximitySensor.kt b/app/src/main/kotlin/d/d/meshenger/call/RTCProximitySensor.kt index d13c9692e..03bc8e478 100644 --- a/app/src/main/kotlin/d/d/meshenger/call/RTCProximitySensor.kt +++ b/app/src/main/kotlin/d/d/meshenger/call/RTCProximitySensor.kt @@ -66,6 +66,7 @@ class RTCProximitySensor(context: Context) : SensorEventListener { /** Deactivate the proximity sensor. */ fun stop() { threadChecker.checkIsOnValidThread() + onSensorStateListeners.clear() Log.d(this, "stop() ${Utils.getThreadInfo()}") if (proximitySensor != null) { Log.d(this, "stop() unregisterListener")