init the proximity sensor immediately, not just as the call starts

This commit is contained in:
tibbi 2020-05-01 19:02:44 +02:00
parent 4058fc3a4e
commit 0aea7f5ad1
1 changed files with 1 additions and 1 deletions

View File

@ -158,7 +158,6 @@ class CallActivity : SimpleActivity() {
private fun callStarted() {
incoming_call_holder.beGone()
ongoing_call_holder.beVisible()
proximityWakeLock?.acquire(10 * MINUTE_SECONDS * 1000L)
audioManager.mode = AudioManager.MODE_IN_CALL
callTimer.scheduleAtFixedRate(getCallTimerUpdateTask(), 1000, 1000)
}
@ -227,6 +226,7 @@ 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.contacts.pro:wake_lock")
proximityWakeLock!!.acquire(10 * MINUTE_SECONDS * 1000L)
}
@SuppressLint("NewApi")