mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
only acquire a wake lock if a lock is not already held
This commit is contained in:
parent
4949a06343
commit
8b96d8cd8d
1 changed files with 3 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue