зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1255222 - Implement InputConnection.getHandler for Android N; r=esawin
Implement the new InputConnection.getHandler method for running input methods on a separate thread in Android N.
This commit is contained in:
Родитель
6455e570f8
Коммит
2a49ee9839
|
@ -454,17 +454,22 @@ class GeckoInputConnection
|
|||
return config.keyboard != Configuration.KEYBOARD_NOKEYS;
|
||||
}
|
||||
|
||||
@Override
|
||||
// Android N: @Override // InputConnection
|
||||
public Handler getHandler() {
|
||||
if (isPhysicalKeyboardPresent()) {
|
||||
return ThreadUtils.getUiHandler();
|
||||
}
|
||||
|
||||
return getBackgroundHandler();
|
||||
}
|
||||
|
||||
@Override // InputConnectionListener
|
||||
public Handler getHandler(Handler defHandler) {
|
||||
if (!canReturnCustomHandler()) {
|
||||
return defHandler;
|
||||
}
|
||||
|
||||
if (isPhysicalKeyboardPresent()) {
|
||||
return mEditableClient.setInputConnectionHandler(defHandler);
|
||||
}
|
||||
|
||||
return mEditableClient.setInputConnectionHandler(getBackgroundHandler());
|
||||
return mEditableClient.setInputConnectionHandler(getHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Загрузка…
Ссылка в новой задаче