Timed out waiting on IInputContextCallback with custom keyboard on Android

瘦欲@ 提交于 2019-12-22 10:25:40

问题


We've developed a custom keyboard for Android and we're facing a weird issue. The issue currently only happens on few devices and on our login website... But it causes our keyboard to hang for a very long time eventually giving the user the option to close or continue to wait.

To be precise we have a custom keyboard which has a login page (fragment webview) that has slow response time for key inputs.

Following stack trace is the important part:

11-17 09:35:07.535 5935-5935/xxx W/InputConnectionWrapper.ICC: Timed out waiting on IInputContextCallback

The Android source file can be read here: https://android.googlesource.com/platform/frameworks/base.git/+/b798689749c64baba81f02e10cf2157c747d6b46/core/java/com/android/internal/view/InputConnectionWrapper.java

But the problem is it is waiting on something that I can't see the source for (an aidl file): https://android.googlesource.com/platform/frameworks/base.git/+/android-4.2.2_r1/core/java/com/android/internal/view/IInputContext.aidl

So I have no idea about what we're doing wrong (other keyboards don't have this issue) and I don't really know how I should debug it. I've tryed accessing the webpage from chrome with no issues also from the app with other keyboards enabled and still no issues.

Any ideas on how to proceed would be greatly appreciated.


回答1:


So this seems to be a "bug" introduced by Android 7.0 (maybe related to the new web client). The bug simply is a custom keyboard in the same process as WebView will give issues with input fields. The solution is to put the activity with WebView(s) in a seperate process.

Example manifest:

    <activity
        android:process=":webactivity"
        android:label="real label"
        android:name="com.something.activity"
        />


来源:https://stackoverflow.com/questions/40650643/timed-out-waiting-on-iinputcontextcallback-with-custom-keyboard-on-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!