mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Fix crash with WakeLock
This commit is contained in:
parent
8045d61e1f
commit
8ead371603
1 changed files with 6 additions and 2 deletions
|
@ -62,7 +62,9 @@ class CallProximityManager @Inject constructor(
|
|||
*/
|
||||
fun stop() {
|
||||
sensorManager.unregisterListener(this)
|
||||
wakeLock?.release()
|
||||
wakeLock
|
||||
?.takeIf { it.isHeld }
|
||||
?.release()
|
||||
}
|
||||
|
||||
override fun onAccuracyChanged(sensor: Sensor?, accuracy: Int) {
|
||||
|
@ -91,6 +93,8 @@ class CallProximityManager @Inject constructor(
|
|||
}
|
||||
|
||||
private fun onProximityFar() {
|
||||
wakeLock?.release()
|
||||
wakeLock
|
||||
?.takeIf { it.isHeld }
|
||||
?.release()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue