Fixed potential ANR when using auto answer
This commit is contained in:
parent
63a8fdd118
commit
1a1bfee678
1 changed files with 4 additions and 6 deletions
|
@ -142,13 +142,11 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
||||||
Log.w("[Context] Auto answering call immediately")
|
Log.w("[Context] Auto answering call immediately")
|
||||||
answerCall(call)
|
answerCall(call)
|
||||||
} else {
|
} else {
|
||||||
val timer = Timer("Auto answer scheduler")
|
|
||||||
Log.i("[Context] Scheduling auto answering in $autoAnswerDelay milliseconds")
|
Log.i("[Context] Scheduling auto answering in $autoAnswerDelay milliseconds")
|
||||||
timer.schedule(object : TimerTask() {
|
val mainThreadHandler = Handler(Looper.getMainLooper())
|
||||||
override fun run() {
|
mainThreadHandler.postDelayed({
|
||||||
Log.w("[Context] Auto answering call")
|
Log.w("[Context] Auto answering call")
|
||||||
answerCall(call)
|
answerCall(call)
|
||||||
}
|
|
||||||
}, autoAnswerDelay.toLong())
|
}, autoAnswerDelay.toLong())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue