mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-17 19:58:57 +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…
Add table
Reference in a new issue