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