From 9f4f6681a94cc724ac1514dedce1cec56d0db9b6 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Wed, 20 Aug 2014 14:05:33 +0900 Subject: [PATCH] Use #onStartInputInternal to initialize cursor rect retrieval This CL simply moves the method calls of #requestCursorAnchorInfo into #onStartInputInternal just to consolidate the logic. Change-Id: Ia205738b9614e9ae375c1dab767a91d2e1f6d0d3 --- .../android/inputmethod/latin/LatinIME.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 258f21f7c..eec08f2d3 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -420,18 +420,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (latinIme != null) { executePendingImsCallback(latinIme, editorInfo, restarting); latinIme.onStartInputInternal(editorInfo, restarting); - if (ProductionFlags.ENABLE_CURSOR_RECT_CALLBACK) { - InputConnectionCompatUtils.requestCursorRect( - latinIme.getCurrentInputConnection(), true /* enableMonitor */); - } - if (ProductionFlags.ENABLE_CURSOR_ANCHOR_INFO_CALLBACK) { - // AcceptTypedWord feature relies on CursorAnchorInfo. - if (latinIme.mSettings.getCurrent().mShouldShowUiToAcceptTypedWord) { - InputConnectionCompatUtils.requestCursorAnchorInfo( - latinIme.getCurrentInputConnection(), true /* enableMonitor */, - true /* requestImmediateCallback */); - } - } } } } @@ -766,6 +754,18 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void onStartInputInternal(final EditorInfo editorInfo, final boolean restarting) { super.onStartInput(editorInfo, restarting); + if (ProductionFlags.ENABLE_CURSOR_RECT_CALLBACK) { + InputConnectionCompatUtils.requestCursorRect(getCurrentInputConnection(), + true /* enableMonitor */); + } + if (ProductionFlags.ENABLE_CURSOR_ANCHOR_INFO_CALLBACK) { + // AcceptTypedWord feature relies on CursorAnchorInfo. + if (mSettings.getCurrent().mShouldShowUiToAcceptTypedWord) { + InputConnectionCompatUtils.requestCursorAnchorInfo( + getCurrentInputConnection(), true /* enableMonitor */, + true /* requestImmediateCallback */); + } + } } @SuppressWarnings("deprecation")