5

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.

Warpzit
  • 27,966
  • 19
  • 103
  • 155

1 Answers1

9

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"
        />
Warpzit
  • 27,966
  • 19
  • 103
  • 155
  • Hi @Warpzit, is there any other solution you found? Because I don't want to make a keyboard as a separate process. I am facing this issue when webview open in the same app(keyboard's app). In other app's webview working fine without the different process of keyboard – Priyanka Feb 19 '20 at 11:32
  • 1
    @Priyankagb This was the only solution I found. The keyboard will have same process as the app, it is the activities hosting webviews that will need separate process. – Warpzit Feb 20 '20 at 10:06