Merge pull request #4728 from vector-im/feature/adm/proxity-sensor-not-releasing

Proximity sensor not releasing
This commit is contained in:
Benoit Marty 2021-12-15 21:23:12 +01:00 committed by GitHub
commit 63660ab496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

1
changelog.d/2467.bugfix Normal file
View File

@ -0,0 +1 @@
Fixing proximity sensor still being active after a call

View File

@ -93,7 +93,9 @@ class CallProximityManager @Inject constructor(
if (wakeLock == null) {
wakeLock = powerManager.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, generateWakeLockTag())
}
wakeLock?.acquire(WAKE_LOCK_TIMEOUT_MILLIS)
wakeLock
?.takeIf { !it.isHeld }
?.acquire(WAKE_LOCK_TIMEOUT_MILLIS)
}
private fun onProximityFar() {