diff options
author | Yohei Yukawa <yukawa@google.com> | 2014-08-21 18:38:44 -0700 |
---|---|---|
committer | Yohei Yukawa <yukawa@google.com> | 2014-08-22 00:55:06 -0700 |
commit | a277db28e990d1f6f74ace0c32fe92401660a840 (patch) | |
tree | 88525827dbf2aff28871579a98e73a058a41a545 /core/java/android/inputmethodservice | |
parent | 97a50adde5eaee4216d537b2a90a9f33533d2926 (diff) | |
download | frameworks_base-a277db28e990d1f6f74ace0c32fe92401660a840.zip frameworks_base-a277db28e990d1f6f74ace0c32fe92401660a840.tar.gz frameworks_base-a277db28e990d1f6f74ace0c32fe92401660a840.tar.bz2 |
Remove CursorAnchorInfoRequest and related stuff
This CL removes CursorAnchorInfoRequest and related stuff
in favor of InputConnection.requestUpdateCursorAnchorInfo,
which is more easy to understand. This CL also deprecates
InputMethodManager#updateCursor and related stuff.
Rationale:
1. The spec of #updateCursor says that it provides the cursor
position in local coordinates, while the input method
requires it in the screen coordinates.
2. #updateCursor has never been enabled in AOSP, because
InputMethodManager#isWatchingCursor always returned false.
3. There has been no way to let
InputMethodManager#isWatchingCursor return true.
4. In L, InputMethodManager#updateCursorAnchorInfo is
introduced to address all the issues above.
Given that we no longer need to support #updateCursor,
CursorAnchorInfoRequest is overkill when we need to convey
just a couple of parameters.
BUG: 17185263
BUG: 17182367
Change-Id: I4a577bfd02b37b9e56c80b8b41bb25afa95dd8ef
Diffstat (limited to 'core/java/android/inputmethodservice')
-rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index ba811b7..2eb42a7 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -53,7 +53,6 @@ import android.view.WindowManager.BadTokenException; import android.view.animation.AnimationUtils; import android.view.inputmethod.CompletionInfo; import android.view.inputmethod.CursorAnchorInfo; -import android.view.inputmethod.CursorAnchorInfoRequest; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.ExtractedText; import android.view.inputmethod.ExtractedTextRequest; @@ -1711,13 +1710,12 @@ public class InputMethodService extends AbstractInputMethodService { } /** - * Called when the application has reported a new location of its text cursor. This is only - * called if explicitly requested by the input method. The default implementation does nothing. - * @param newCursor The new cursor position, in screen coordinates if the input method calls - * {@link InputConnection#requestCursorAnchorInfo(CursorAnchorInfoRequest)} with - * {@link CursorAnchorInfoRequest#FLAG_CURSOR_RECT_IN_SCREEN_COORDINATES}. Otherwise, - * this is in local coordinates. + * Called when the application has reported a new location of its text + * cursor. This is only called if explicitly requested by the input method. + * The default implementation does nothing. + * @deprecated Use {#link onUpdateCursorAnchorInfo(CursorAnchorInfo)} instead. */ + @Deprecated public void onUpdateCursor(Rect newCursor) { // Intentionally empty } |