admin管理员组文章数量:1558084
InputContextCallback.waitForResultLocked
Input dispatching timed out (Waiting to send non-key event because the touched window
has not finished processing certain input events that were delivered to it
over 500.0ms ago. waitqueue length = 35, head.seq = 13280142,
Wait queue head age: 5427.8ms.)
参考资料
InputConnectionWrapper代码地址
参考ANR分析
事件处理(版本上线观察中…)
//大概的想法就是通过非阻塞异步线程返回结果
val cursorCapsMode: InputAttributes.CapsMode
get() {
val ic = inputConnection ?: return InputAttributes.CapsMode.NONE
return if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
val cf = CompletableFuture.supplyAsync<InputAttributes.CapsMode>({
InputAttributes.CapsMode.fromFlags(
ic.getCursorCapsMode(inputAttributes.capsMode.toFlags())
)
}, newSingleThreadExecutor())
try {
cf.getNow(InputAttributes.CapsMode.NONE)
} catch (e: Exception) {
e.printStackTrace()
cf.cancel(true)
InputAttributes.CapsMode.NONE
}
} else {
InputAttributes.CapsMode.fromFlags(
ic.getCursorCapsMode(inputAttributes.capsMode.toFlags())
)
}
}
本文标签: InputContextCallbackwaitForResultLockedANR
版权声明:本文标题:InputContextCallback.waitForResultLocked导致的ANR 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1727341526a1109472.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论