init the proximity sensor immediately, not just as the call starts
This commit is contained in:
parent
4058fc3a4e
commit
0aea7f5ad1
1 changed files with 1 additions and 1 deletions
|
|
@ -158,7 +158,6 @@ class CallActivity : SimpleActivity() {
|
||||||
private fun callStarted() {
|
private fun callStarted() {
|
||||||
incoming_call_holder.beGone()
|
incoming_call_holder.beGone()
|
||||||
ongoing_call_holder.beVisible()
|
ongoing_call_holder.beVisible()
|
||||||
proximityWakeLock?.acquire(10 * MINUTE_SECONDS * 1000L)
|
|
||||||
audioManager.mode = AudioManager.MODE_IN_CALL
|
audioManager.mode = AudioManager.MODE_IN_CALL
|
||||||
callTimer.scheduleAtFixedRate(getCallTimerUpdateTask(), 1000, 1000)
|
callTimer.scheduleAtFixedRate(getCallTimerUpdateTask(), 1000, 1000)
|
||||||
}
|
}
|
||||||
|
|
@ -227,6 +226,7 @@ class CallActivity : SimpleActivity() {
|
||||||
private fun initProximitySensor() {
|
private fun initProximitySensor() {
|
||||||
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.contacts.pro:wake_lock")
|
proximityWakeLock = powerManager.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, "com.simplemobiletools.contacts.pro:wake_lock")
|
||||||
|
proximityWakeLock!!.acquire(10 * MINUTE_SECONDS * 1000L)
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue