Android的MultiClientInputMethod示例无法正常工作
我按照Google的官方说明使用MultiClientInputMethodManagerService的示例(https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/inputmethod/multi-client-ime.md
)带有perDisplayFocus的AOSP11模拟器已经构建完成,截图可以看到 在此处输入图像描述
但是 ime 的窗口仅在主显示屏上显示,并且只能在主显示屏上输入主要显示在此处输入图像描述
我添加了一些日志来查看多输入窗口,看来就像已经表明的那样
@Override
public void onShowSoftInput(int flags, ResultReceiver resultReceiver) {
if (DEBUG) {
Log.v(TAG, "onShowSoftInput clientId=" + mClientId + " flags=" + flags);
}
final SoftInputWindow window =
mSoftInputWindowManager.getSoftInputWindow(mSelfReportedDisplayId);
if (window == null) {
return;
}
if (mClientId != window.getClientId()) {
Log.w(TAG, "onShowSoftInput() from a background client is ignored."
+ " windowClientId=" + window.getClientId()
+ " clientId=" + mClientId);
return;
}
window.show();
Log.v(TAG, "is showing"+window.isShowing());
}
AndroidStudio的logcat 在此处输入图片描述 我在Google上搜索了很久没有找到相关问题。有谁用过这个吗,非常感谢有经验的回答者
I follow Google's official instructions to use the example of MultiClientInputMethodManagerService(https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/inputmethod/multi-client-ime.md)
The AOSP11 emulator with perDisplayFocus has been built, the screenshot you can see that
enter image description here
But the ime's window only shows on main display, and can only input on the main displayenter image description here
I have added some log to see the multi input window , it seems like has shown
@Override
public void onShowSoftInput(int flags, ResultReceiver resultReceiver) {
if (DEBUG) {
Log.v(TAG, "onShowSoftInput clientId=" + mClientId + " flags=" + flags);
}
final SoftInputWindow window =
mSoftInputWindowManager.getSoftInputWindow(mSelfReportedDisplayId);
if (window == null) {
return;
}
if (mClientId != window.getClientId()) {
Log.w(TAG, "onShowSoftInput() from a background client is ignored."
+ " windowClientId=" + window.getClientId()
+ " clientId=" + mClientId);
return;
}
window.show();
Log.v(TAG, "is showing"+window.isShowing());
}
The logcat of AndroidStudio enter image description here
I search on Google and has not found relevant questions for a long time.Has anyone used this ,thank you very much for the experienced answerers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了,任何看到这个问题的人都可以参考我的解决方案 https://github.com/Superpengun/MultiDisplayInput
项目中使用的jar是从aosp12编译的classed.jar中提取的,keyboardview是一个dialog,可能dialog的多屏显示有区别。在github的项目中,我重建了AOSP12隐藏api的jar并验证了它
i had solved it , anyone who sees this problem can refer to my solution https://github.com/Superpengun/MultiDisplayInput
The jar used in the project is extracted from the aosp12 compiled classed.jar ,the keyboardview is a dialog,maybe there is a difference of dialog's Multi-screen display. In the github's project i rebuild the jar for hidden api of AOSP12 and verfied it