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