Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Timed out waiting on IInputContextCallback with custom keyboard on Android

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.

like image 259
Warpzit Avatar asked Nov 17 '16 09:11

Warpzit


1 Answers

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"
        />
like image 50
Warpzit Avatar answered Oct 19 '22 11:10

Warpzit