fix #141, avoid an active proximity sensor after a call

This commit is contained in:
tibbi
2021-01-08 15:47:23 +01:00
parent a2be944ccd
commit cc274b35e5

View File

@ -340,9 +340,11 @@ class CallActivity : SimpleActivity() {
}
private fun initProximitySensor() {
val powerManager = getSystemService(Context.POWER_SERVICE) as PowerManager
proximityWakeLock = powerManager.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, "com.simplemobiletools.dialer.pro:wake_lock")
proximityWakeLock!!.acquire(10 * MINUTE_SECONDS * 1000L)
if (proximityWakeLock == null || proximityWakeLock?.isHeld == false) {
val powerManager = getSystemService(Context.POWER_SERVICE) as PowerManager
proximityWakeLock = powerManager.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, "com.simplemobiletools.dialer.pro:wake_lock")
proximityWakeLock!!.acquire(10 * MINUTE_SECONDS * 1000L)
}
}
@SuppressLint("NewApi")