diff options
author | 2014-07-19 13:33:42 +0900 | |
---|---|---|
committer | 2014-07-20 20:56:52 +0900 | |
commit | 3f513f107ef0754da2b1c704167325151ce9b7ea (patch) | |
tree | a66ed2db2714eecd44cf3f9bad2d0f59b2e9e763 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 6b14bbf125f2957ffb3ab5072eb9376981af9a17 (diff) | |
download | latinime-3f513f107ef0754da2b1c704167325151ce9b7ea.tar.gz latinime-3f513f107ef0754da2b1c704167325151ce9b7ea.tar.xz latinime-3f513f107ef0754da2b1c704167325151ce9b7ea.zip |
Enable InputMethodService#onUpdateCursor behind the flag
With this CL, InputMethodService#onUpdateCursor and
InputMethodService#onUpdateCursorAnchorInfo can be enabled
on L when ENABLE_CURSOR_ANCHOR_INFO_CALLBACK and
ENABLE_CURSOR_RECT_CALLBACK are specified, respectively.
BUG: 16382260
Change-Id: I29924128f6bd2f08cbd91cc4e82c9c4a6ecce3ff
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index dd0060f4a..b641f3a8b 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -55,6 +55,7 @@ import android.view.inputmethod.InputMethodSubtype; import com.android.inputmethod.accessibility.AccessibilityUtils; import com.android.inputmethod.annotations.UsedForTesting; +import com.android.inputmethod.compat.InputConnectionCompatUtils; import com.android.inputmethod.compat.InputMethodServiceCompatUtils; import com.android.inputmethod.dictionarypack.DictionaryPackConstants; import com.android.inputmethod.event.Event; @@ -413,11 +414,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (latinIme != null) { executePendingImsCallback(latinIme, editorInfo, restarting); latinIme.onStartInputInternal(editorInfo, restarting); - if (ProductionFlags.USES_CURSOR_ANCHOR_MONITOR) { - // Currently we need to call this every time when the IME is attached to - // new application. - // TODO: Consider if we can do this automatically in the framework. - InputMethodServiceCompatUtils.setCursorAnchorMonitorMode(latinIme, 1); + if (ProductionFlags.ENABLE_CURSOR_RECT_CALLBACK) { + InputConnectionCompatUtils.requestCursorRect( + latinIme.getCurrentInputConnection(), true /* enableMonitor */); + } + if (ProductionFlags.ENABLE_CURSOR_ANCHOR_INFO_CALLBACK) { + InputConnectionCompatUtils.requestCursorAnchorInfo( + latinIme.getCurrentInputConnection(), true /* enableMonitor */, + true /* requestImmediateCallback */); } } } |