Enable CursorAnchorInfo callback when necessary

Change-Id: If3dda7442418053600ac935da50baaddb0e31d37
This commit is contained in:
Yohei Yukawa 2014-08-13 19:50:43 +09:00
parent 6e7806bc00
commit d9a8e1ccfd
2 changed files with 7 additions and 4 deletions

View file

@ -424,6 +424,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
latinIme.getCurrentInputConnection(), true /* enableMonitor */); latinIme.getCurrentInputConnection(), true /* enableMonitor */);
} }
if (ProductionFlags.ENABLE_CURSOR_ANCHOR_INFO_CALLBACK) { if (ProductionFlags.ENABLE_CURSOR_ANCHOR_INFO_CALLBACK) {
// AcceptTypedWord feature relies on CursorAnchorInfo.
if (latinIme.mSettings.getCurrent().mShouldShowUiToAcceptTypedWord) {
InputConnectionCompatUtils.requestCursorAnchorInfo( InputConnectionCompatUtils.requestCursorAnchorInfo(
latinIme.getCurrentInputConnection(), true /* enableMonitor */, latinIme.getCurrentInputConnection(), true /* enableMonitor */,
true /* requestImmediateCallback */); true /* requestImmediateCallback */);
@ -431,6 +433,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
} }
} }
} }
}
public void onStartInputView(final EditorInfo editorInfo, final boolean restarting) { public void onStartInputView(final EditorInfo editorInfo, final boolean restarting) {
if (hasMessages(MSG_PENDING_IMS_CALLBACK) if (hasMessages(MSG_PENDING_IMS_CALLBACK)

View file

@ -29,7 +29,7 @@ public final class ProductionFlags {
* and prior. In general, this callback provides more detailed positional information, * and prior. In general, this callback provides more detailed positional information,
* even though an explicit support is required by the editor. * even though an explicit support is required by the editor.
*/ */
public static final boolean ENABLE_CURSOR_ANCHOR_INFO_CALLBACK = false; public static final boolean ENABLE_CURSOR_ANCHOR_INFO_CALLBACK = true;
/** /**
* When true, enable {@link InputMethodService#onUpdateCursor} callback via * When true, enable {@link InputMethodService#onUpdateCursor} callback via