History log of /frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
67e2ae86396c6d0f989285275cbf908dee5e71f7 12-Oct-2016 Aurimas Liutikas <aurimas@google.com> Fix import statement in view|transition|animation packages.

This change also remove trailing whitespace.

Test: code still compiles
Change-Id: I7eff4546320d67d2bae58d31bad0625ea0791b8f
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
45700fa135e83ed44e4b69ca60cf12960a5898d7 24-Jun-2016 Yohei Yukawa <yukawa@google.com> Use a flag to grant a temporary URI permission.

It turns out that we can let the system to call
InputMethodService#exposeContent(InputContentInfo, EditorInfo), which
added in my previous CL [1], during the IME is calling
InputConnection#commitContent() as follows.

[IME]
InputContentInfo contentInfo = new InputContentInfo(
contentUri,
new ClipDescription(description, new String[]{mimeType}),
linkUrl);
getCurrentInputConnection().commitContent(
inputContentInfo,
InputConnection.INPUT_CONTENT_GRANT_READ_URI_PERMISSION,
null);

[App]
try {
contentInfo.requestPermission();
// Load inputContentInfo.getContentUri() here.
} finally {
contentInfo.releasePermission();
}

This gives us flexibility to let InputConnection#commitContent() do all
the magic for IME developers like other APIs such as
Context#startActivity(), rather than asking them to call one more API to
grant a temporary URI permission like a scenario where
Context#grantUriPermission() is used.

[1]: I2772889ca01f2ecb2cdeed4e04a9319bdf7bc5a6
25e0813e6eb6315b1016db805fa9b791b4ae5cc2

Bug: 29450031
Change-Id: I99536cd58c9984af30b0bafb4a1dd25a26634a2d
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
adebb52588b098a1af678d4e33a234ef1ce783b2 17-Jun-2016 Yohei Yukawa <yukawa@google.com> API Rename: IC#inputContent to IC#commitContent.

As shown in below, we have already used commit* naming convention in
InputConnection.

- InputConnection#commitCompletion(CompletionInfo);
- InputConnection#commitCorrection(CorrectionInfo);
- InputConnection#commitText(CharSequence, int);

Hence renaming IC#inputContent() to IC#commitContent() would make the
new method more consistent.

Bug: 29450024
Change-Id: Ica1ba3154795c1bf44e140dfe639b299f83cd8af
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
152944f4909c47917473293b258d266435c6ab35 11-Jun-2016 Yohei Yukawa <yukawa@google.com> Add InputConnection#insertContent().

Providing an official protocol for IMEs to insert an image to the
application is something that has been requested from many IME
developers to Android OS. With this CL, IMEs are able to ask
applications to insert a content including image files as follows.

1. An application that opts in to this protocol specifies a list of
supported content MIME types in EditorInfo#contentMimeTypes.
2. When an IME is actively interacting with such an application, the
IME can call InputConnection#insertContent() with a InputContentInfo
that contains content URI, metadata (ClipDescription), and an
optional link URI.
3. The application can read the stream data from the given content URI
to insert the content into somewhere in the application.

Detailed design background can be found in the JavaDoc of
InputConnection#insertContent().

Bug: 22830793
Change-Id: Iaadf934a997ffcd6000a516cc3c1873db56e60ad
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
9f9afe526d1f8ad17c628fc9e1e839725ffe913e 30-Mar-2016 Yohei Yukawa <yukawa@google.com> Add IC#closeConnection().

It turns out that BaseInputConnection has still depended on a private
API named BaseInputConnection#reportFinish(), which was introduced
4 years ago to work around a UI freeze due to an unbalanced batch edit
count [1]. Note that such an unbalanced batch edit count cannot always
be avoidable. It can easily occur in the following situations.
- The current IME crashed during batch edit.
- The user changed the View focus during batch edit.
- The current IME called IMM#switchToNextInputMethod() during batch
edit.

The remaining problem is that #reportFinish() is still an internal API
and only subclasses of BaseInputConnection can implement it, and IMM
calls it when and only when the current InputConnection is
BaseInputConnection or its subclass. InputConnectionWrapper and any
other InputConnection implementations will never receive such a callback
to clean up InputConnection#{begin, end}BatchEdit(), which is considered
to be a major contributor to UI freeze.

To address the above issue, we unhide BaseInputConnection#reportFinish()
as InputConnection#closeConnection() so that application developers can
receive an appropriate callback to clean up internal state including
unfinished batch edit.

[1] I5525d776916f0c42d5e6d4a4282aed590d7f0e9a
9d69ecbf61a4a142c3f4cbb9d5659faa6f85e832

Bug: 24688781
Bug: 25332806
Change-Id: I234309c5880c9fe0b299b8bd0f8862796d4dda0d
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
aaa38c9f1ae019f0fe8c3ba80630f26e582cc89c 28-Mar-2016 Yohei Yukawa <yukawa@google.com> Ensure IC#finishComposingText() is called on the correct Handler.

This attempts to reland previously reverted CLs [1][2] due to an
unexpected regression (Bug 27824691).

The Bug 27868748 we want to address by this CL is that currently
InputConnection#finishComposingText() can be called on the root view's
Handler no matter what Handler is associated with
ControlledInputConnectionWrapper. Actually the root cause of
Bug 6789252 is the same, but there we worked around it by not calling
InputConnection#finishComposingText() in certain situations [3].
With this CL we should be able to logically revert that workaround.

This CL also removes redundant IMM#mServedInputConnection. This is safe
because the following two fields have the same lifetime.
- InputMethodManager#mServedInputConnection
- InputMethodManager#mServedInputConnectionWrapper
We do not need to maintain both of them. This also allows us to use a
strong refecente in IInputConnectionWrapper#mInputConnection instead of
a WeakReference. To understand why this is safe, we need to understand
how things previously worked, which is as follows:

1. InputMethodManager#mServedInputConnection becomes non-null.
-> IInputConnectionWrapper#mInputConnection.get() is guaranteed to
be alive.
2. InputMethodManager#mServedInputConnection becomes null or another
object.
-> IInputConnectionWrapper#mInputConnection.get() may not be alive.

Since we know exactly when InputMethodManager#mServedInputConnection is
updated, in theory we do not need to use WeakReference here, and
with this CL we do not use WeakReference anymore. Actually the initial
commit [1] accidentally removed the last strong reference to the active
InputConnection and WeakReference could be null at any time, which was
what we observed in Bug 27824691.

[1]: I1181e067aa5bedbdf0c7ec1bcec479257aea511c
afb6558c8f5e0ee797b252558d7e529e3d946d8f
[2]: Ibe94f115e607a198d12ecd3d4e4f91a7d9469c98
16e2c7b59aacf44df7aaa0d04e0228240907487f
[3]: I66f51da1299532793ef8fa700f35b0811670f235
4e5184f929d2498714bc7734fe10b9b8810cb071

Bug: 27868748
Change-Id: If2a03bc84d318775fd4a197fa43acde086eda442
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
1fa5f594a26b00aa137703bb21e186910c1242c6 24-Mar-2016 Yohei Yukawa <yukawa@google.com> Revert "Make sure to call back reportFinish() on the desired Handler."

This reverts commit 16e2c7b59aacf44df7aaa0d04e0228240907487f.

It turns out that I1181e067aa5bedbdf0c7ec1bcec479257aea511c caused
a serious regression Bug 27824691. To revert that CL, we have to revert
this one first.

Bug: 25332806
Bug: 27824691
Change-Id: Iadfc226eb91cc969b77c9d98e04ec3c76fe86ead
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
16e2c7b59aacf44df7aaa0d04e0228240907487f 23-Mar-2016 Yohei Yukawa <yukawa@google.com> Make sure to call back reportFinish() on the desired Handler.

Before exposing #reportFinish() as a public API, we have to fix an
existing bug that my previous CL [1] for Bug 26945674 forgot to take care.

Currently BaseInputConnection#reportFinish() is always called by using
the root view's Handler. We should move the logic to call
BaseInputConnection#reportFinishInputConnection() from ViewRootImpl to
IInputConnectionWrapper to make sure that the method in question can
always be called on the desired Handler.

To make things simple, instead of explicitly calling #reportFinish()
from IMM, this CL let ControlledInputConnectionWrapper#diactivate()
internally call #reportFinish() as needed. This makes it easier to make
sure that #reportFinish() is called after all the queued method calls
are handled.

[1]: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
612cce92ad96eda1146c3abd2afa7aaa4d4f2b3f

Bug: 25332806
Change-Id: Ibe94f115e607a198d12ecd3d4e4f91a7d9469c98
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
612cce92ad96eda1146c3abd2afa7aaa4d4f2b3f 12-Feb-2016 Yohei Yukawa <yukawa@google.com> Introduce InputConnection#getHandler().

Currently there is an internal hidden class named
ControlledInputConnectionWrapper which works as a proxy in the
application process to receive incoming binder calls from input method
and dispatch those method calls again on an appropriate thread.
Although this is a kind of implementation details, basically you can see
the same design everywhere in the Android.

Currently ControlledInputConnectionWrapper is initialized with
view.getHandler(), where the view here is the View which was used to
call View#onCreateInputConnection(). This is actually a reasonable
behavior because we have generally assumed that there the only
reasonable way to implement InputConnection is to extend
BaseInputConnection, which is designed to be able to work only on the
UI-thread associated with the target view.

However, on Android N and onward, we are going to ensure that
BaseInputConnection can be re-implemented on top of public APIs [1].
Although most of applications should not try to do that, for certain
applications such as web browsers and WebView it may make sense to let
custom InputConnection implementation run with a custom Handler so that
the application can respond to the IME without blocking the UI thread.

To do that, this CL introduces a new method
InputConnection#getHandler(), which changes nothing as long as it
returns null, but if it returns non-null Handler, InputMethodManager
will use it to initialize ControlledInputConnectionWrapper.

Note that InputConnection#getHandler() is not for IME developers.
It just returns null when called in the IME process.

[1] See Bug 24688781 for details.

Bug: 26945674
Change-Id: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
ac3e599069e1b87ea190f008aef60a506c8561c7 18-Jan-2016 Yohei Yukawa <yukawa@google.com> Merge "Introdude IC#deleteSurroundingTextInCodePoints()."
f1fc5a0fe802f8cbf477b1ef54b25127818e091d 15-Jan-2016 Yohei Yukawa <yukawa@google.com> Merge changes Ib5ea8131,I571d6cc9

* changes:
Add a new API IMM#dispatchKeyEventFromInputMethod().
BaseInputConnection shouldn't rely on @hide APIs.
c89e22a6ff227089fde26daea186346029d1b32c 14-Jan-2016 Yohei Yukawa <yukawa@google.com> Introdude IC#deleteSurroundingTextInCodePoints().

This CL introduces a API variant of IC#deleteSurroundingText(), named
IC#deleteSurroundingTextInCodePoints(). Major differences from
the existing one are:
- The lengths are supplied in code points rather than code units.
- This API does nothing if there are one or more invalid surrogate
pairs in the requested range. (Failure Atomicity)

Note that due to the asynchronous nature of the input method
architecture in Android, implementing the same logic in the input method
side basically ends up with unreliable and unpredictable results.

Bug: 6526420
Change-Id: I7f6a2c5d3d52079ae71623fd5e40d60c688dd5fb
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
2afe2aa15f7cd98e372d222fa5c21bede865e5b9 08-Jan-2016 Yohei Yukawa <yukawa@google.com> Add a new API IMM#dispatchKeyEventFromInputMethod().

This is a part of effort to reduce the number of dependencies on @hide
method in BaseInputConnection.

Currently BaseInputConnection#sendKeyEvent() cannot be implemented
without relying on @hide internal fields in InputMethodManager.

This is not ideal because app developers cannot implement their own
InputConnection without relying on BaseInputConnection. If this
functionality needs to be exposed to app developers anyway, then it
should be a public API.

Bug: 24688781
Change-Id: Ib5ea8131de5ba792b10e1a4e51b4d163cf3649e3
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
159dd47db34151314e2449347251ad32b30e5ea1 08-Jan-2016 Yohei Yukawa <yukawa@google.com> BaseInputConnection shouldn't rely on @hide APIs.

This is a part of effort to reduce the number of dependencies on @hide
method in BaseInputConnection.

In a nutshell, IMM#notifyUserAction() and IMM#setFullscreenMode() are
something that IME developers should not care about, hence ideally
BaseInputConnection should not rely on them.

IMM#setFullscreenMode():
This @hide method is just for updating an internal state flag about
whether the current IME is in full screen mode or not.

IMM#notifyUserAction():
This @hide methods is just for sending a signal to IMMS so that IME
rotation list (for globe button) can be updated based on the user's
action.

Depending on those @hide methods in BaseInputConnection is problematic
because:

A. We cannot implement InputConnection without relying on
BaseInputConnection, which forces developers to use Editable to
maintain internal text representations.
B. If BaseInputConnection#commitText is overridden,
those @hide method calls can be missed.
C. Currently some method calls of BaseInputConnection() even from
application itself can trigger those @hide method calls. Ideally
those internal events can be dispatched only when those methods are
called from the input method rather than the application itself.

With this CL, those @hide API calls will be moved from
BaseInputConnection to ControlledInputConnectionWrapper so that
developers can forget about them.

Note that BaseInputConnection#sendKeyEvent() still relies on @hide
internal details of IMM. It should be addressed in a subsequent CL.

Bug: 24688781
Change-Id: I571d6cc9c6e461d8994aa7496e7e18be13766411
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
5f137933d130e8e5f9d0d2285f6799e459befb5a 07-Jan-2016 Yohei Yukawa <yukawa@google.com> Enrich JavaDoc for IC#deleteSurroundingText().

As a preparation work for Bug 6526420, where we are going to
introduce a new variant of IC#deleteSurroundingText(), this CL attempts
to clarify about the expected behavior of IC#deleteSurroundingText().

With this CL, the expected behavior when the number of existing
characters is smaller than the number of characters to be deleted is
now documented by simply describing the current behavior of
BaseInputConnection, that is, IC#deleteSurroundingText() will delete
characters until it deletes requested number of characters in code units
or reaches to an end.

This is purely documentation work. No behavior change is intended.

Bug: 6526420
Change-Id: I7280dec07e1c043bd26b3b12fd866b9d8b6186cc
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
3fadee479107f0494e1e190aba2a1eea12cb0a75 08-Sep-2014 Yohei Yukawa <yukawa@google.com> API Review: Clean up removed APIs

This CL removes old API signatures marked as @removed
in the follow CLs.
- Ic8c6fab58c01206872a34e7ee604cdda1581364d
- Ia8cbb9f6b41cd9509fc0147fd68763dfde593ffc
- I772c48ff18918e48a81e807b48ff907614485c09

This is just a clean-up CL. No behavior change is intended.

BUG: 17200900
BUG: 17320996
BUG: 17365414
Change-Id: Ibfbd5cc1cdebb8851c73477cff55c9b2d631fdea
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
d8636ea7ca78df83d6b04088eab7853f15f3e999 03-Sep-2014 Yohei Yukawa <yukawa@google.com> API Review: InputConnection

This CL does nothing but rename some L API candidates
in InputConnection class, as per requested.

- requestUpdateCursorAnchorInfo()
-> requestCursorUpdates()
- REQUEST_UPDATE_CURSOR_ANCHOR_INFO_IMMEDIATE
-> CURSOR_UPDATE_IMMEDIATE
- REQUEST_UPDATE_CURSOR_ANCHOR_INFO_MONITOR
-> CURSOR_UPDATE_MONITOR

BUG: 17320996
Change-Id: I772c48ff18918e48a81e807b48ff907614485c09
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
a277db28e990d1f6f74ace0c32fe92401660a840 22-Aug-2014 Yohei Yukawa <yukawa@google.com> 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
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
ff328ae7438a9c5c2fe49c286833a30e25015e63 17-Jul-2014 Yohei Yukawa <yukawa@google.com> Add FLAG_CURSOR_ANCHOR_INFO_IMMEDIATE support in TextView

This CL adds an initial support of
CursorAnchorInfoRequest#FLAG_CURSOR_ANCHOR_INFO_IMMEDIATE for
TextView.

This implementation is not highly optimized yet, but it just
works as it should.

BUG: 16379288
Change-Id: Iecb32b4c4dcd7db14d8b2a0d929e1d64e161bc58
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
0023d0e0c4f5339b299d1eacbd4e7181c2fd271f 10-Jul-2014 Yohei Yukawa <yukawa@google.com> Polish new IME API for L part 2: CursorAnchorInfo

This CL addresses feedbacks from internal customers for new
input method APIs that are mainly used for physical keyboard
support in L.

For performance reasons, #onUpdateCursorAnchorInfo is not called
back by default and each input method has to enable this
event notification explicitly whenever fine-grained character
locations are needed.

In L-preview, InputMethodSession#setCursorAnchorMonitorMode was
introduced for this purpose. However, we got several feedbacks
to be addressed.
- The effect of #setCursorAnchorMonitorMode is not preserved
during focus change. IMEs need to call
#setCursorAnchorMonitorMode every time when #onStartInput is
called. This is tricky and hard to understand.
- As #onUpdateCursorAnchorInfo is a new API, not all
applications/text editors have supported it. Therefore IMEs
can't always rely on it. However, there is no way to query
if the attached target is supporting this new API or not.
It would helpful for IME authors if we can provide a
reliable way to query if the attached input target is
supporting the new API or not.

In order to address these issues, the triggering method has
moved from InputMethodSession to InputConnection in this CL,
as an analogy of existing InputConnection#getExtractedText API,
which has provided similar functionality including optional
reactive event callbacks from the application to the IME.

BUG: 15812658
BUG: 16118603
Change-Id: I3c6b69bd9d79b199afe68d838f25effa6048e5cc
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
39dd1510ea2bfb79709075f352384730862fd4c4 05-Jun-2014 Yohei Yukawa <yukawa@google.com> Use more user actions to update the IME rotation order

Previously, only the text update event in composing mode
is used to update the IME rotation order. This may look strange
to a user especially when the character is input without
composition.

With this CL, to cover above cased, sending a key event is also
used as a trigger to update update the rotation order.

Note that the cost of calling IMM#notifyUserAction multiple times
is now cheap enough because of the optimization made in
I19ad8542659bc092b92ee13e.

BUG: 7043015
Change-Id: I03fa436df0a5e348b3f93170aab3a8ac5a7e1677
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
0297051162193ef2b7d906409868e404f77e4c31 05-Jun-2014 Yohei Yukawa <yukawa@google.com> Trivial method renaming for notifyTextCommitted

This CL does not change existing behavior but only renames
notifyTextCommitted with notifyUserAction so that we can use
not only text commit but also other actions such as just typing
a character will be used as a trigger to update the IME
rotation order for better IME switching experience.

BUG: 7043015
Change-Id: I7f3e13a7226ef0dceee82b67e8a0d8536f7e9807
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
ef0904106d09a5471f809feec4219dc22fc740fe 17-Jan-2014 Yohei Yukawa <yukawa@google.com> Make the range checking of BaseInputConnection#setSelection stricter

With this change, setSelection will not cause java.lang.IndexOutOfBoundsException
even if a negative index is specified.

Bug: 8841916
Change-Id: Ib62a6ba235f80b7495fefb2e5cc2d5357d804310
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
d7443c83ceae0bdd20d68bf84648cf3b40115d85 15-Oct-2013 Satoshi Kataoka <satok@google.com> Notify commitText event to InputMethodManagerService

for the intelligent subtype switching

Bug: 7043015
Change-Id: I11ed9a767588f8080753cd9bce011dac7db579ad
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
e507c840c83f83baf724780e79215a40fbbf02c9 31-May-2013 Jean Chalard <jchalard@google.com> am 44baed2d: am af9e5e5f: Merge "Improve the documentation for InputConnection." into jb-mr2-dev

* commit '44baed2dc31d29c48f5d49577c109ca3903ad915':
Improve the documentation for InputConnection.
e811de2d6cd736b36a2a2ff552e6893a4a021045 24-May-2013 Jean Chalard <jchalard@google.com> Improve the documentation for InputConnection.

- Add many details to most methods.
- Add comments specific to IME authors and to editor authors.
- Add missing return value docs.
- Straighten out single-spacing vs double spacing.

Bug: 8843866
Change-Id: If1f6dcf0457d5332a7ebb1ebfb1967c6ff0df722
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
aaf8671c439670f0a72401379431ddd72ff368c4 02-Mar-2013 Jean Chalard <jchalard@google.com> Final small cleanup.

This does not change anything in the practice since the only
time where timing of the endBatchEdit() call matters is when
sendCurrentText is a no-op. Still, it's theoretically correct
to do it in this order.
This concludes a four-step refactoring moving where the
editor calls updateSelection to warn the IME of a cursor move.

Change-Id: I3109a482ec1d4cd9b4ffb33cc363a4ce5128861a
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
9d69ecbf61a4a142c3f4cbb9d5659faa6f85e832 25-Feb-2012 Gilles Debunne <debunne@google.com> InputConnection is warned when finished

As said in https://android-git.corp.google.com/g/#/c/155992
finishComposingText is indeed too broad of a method.

Introducing a new dedicated method to warn the InputConnection.

Should solve the problems with a negative counter value.

Change-Id: I5525d776916f0c42d5e6d4a4282aed590d7f0e9a
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
e0dbd002750856e55d637e883b629e09adfc8a4e 16-Feb-2012 Jeff Brown <jeffbrown@google.com> Mark input and sensor messages as asynchronous.

Set a barrier on traversals.

Vsync is still not enabled by default in this patch so there
should be no observable effect from these changes.

Change-Id: Ie12081b95a8f1e81ed686edf747cc62f2e044b7e
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
a175a5b7ea3682cb58cca7f9726d0b8171cd549d 16-Feb-2012 Jeff Brown <jeffbrown@google.com> Encapsulate the ViewRootImpl's handler.

This change makes it much easier to make sense of the messages that
get posted to the ViewRootImpl's handler by encapsulating their point
of dispatch within the ViewRootImpl itself.

As part of this change, the View.AttachInfo now carries a reference
to the ViewRootImpl itself, which simplifies some code that used
to try to find the ViewRootImpl by getting the root view's parent.

In principle, it might have been nice to hide the ViewRootImpl from
the View hierarchy but in practice the two were coupled in many ways.

Change-Id: I51ebccdf5f8c8c505cd6f17cdf594174d041dc54
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
0c95dd3f4f02564fab9b86a221bbcbb4aafc2981 24-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug # 5863709 API request: Change param names of deleteSurroundingText to "before" and "after"

Change-Id: I727fad9a59cda915899674569bfabd29b9f5da60
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
6dd005b48138708762bfade0081d031a2a4a3822 18-Jul-2011 Dianne Hackborn <hackbod@google.com> I. Can. Not. Stand. ViewAncestor.

It was done so we would have the name "ViewRoot" available for a
public API. However, the name "ViewAncestor" just makes no sense.
So instead, change it to ViewRootImpl.

Change-Id: If9599ca67896f339f6fefa7d1dde121201171d97
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
f9f01008624e2d28c15a90d942fa36f98c8c967d 19-May-2011 satok <satok@google.com> Add Apis to send notifications when the suggestion was picked

- Due to a strong request from VoiceIME

Bug: 4443922

Change-Id: Ia539de0acf66053e0349daec459d75e36805f6bf
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
c6cc0f8c19d9eccf408a443fa2bf668af261dcd0 12-Apr-2011 Joe Onorato <joeo@google.com> Rename ViewRoot to ViewAncestor.

ViewRoot is about to be a new public class for poking at ViewAncestor.

Change-Id: Ie95d707c6d8bbb48f78d093d7b2667851812a7d5
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
e3797a15fbf769a0abcbe121cfd33b4b658aea1e 21-Mar-2011 satok <satok@google.com> Removed APIs for setCorrectionSpan from InputConnection

("setCorrectionSpan" was added in Id3abc9ea4d11753cd )

Also..
- Added a class java doc for CorrectionSpan
- Removed FLAG_DEFAULT
- Changed the return type of getSuggestions from Array<CharSequence> to String[]

Change-Id: If5eb091e307a7a40c5b4a70ec1fe6059ecd9fb2d
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
adb435835fb9a5f2bb74d29930b239dde18504a7 09-Mar-2011 satok <satok@google.com> Add CorrectionSpan and APIs to pass a secure CorrectionSpan to TextView

- CorrectionSpan is a span which has suggestions made by IME.
This has a function to change the current IME to other IME specified
in this span. For security reasons, only the current IME
is allowed to use this function through InputConnection.
(IME token is used for checking the validity of it.).

- CorrectionSpan stores following information:

flags, subtype Id, InputMethodInfo Id, suggests, locale, original string

Change-Id: Id3abc9ea4d11753cdc4f483a2bb3128f49ba198a
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
cf9cf2f40efc4ccf3f73e6fdb07725d9c00c4f91 09-Dec-2010 Gilles Debunne <debunne@google.com> New API in InputConnection to signal IME's text correction.

Scafolding so that the IME team can start working on this feature.

The animation part in the TextView is missing.

Change-Id: I8225538564370fba1500e3539742a8ab79bdd199
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
6b53e8daa69cba1a2a5a7c95a01e37ce9c53226c 11-Nov-2010 Jeff Brown <jeffbrown@google.com> Added support for full PC-style keyboards.

BREAKING CHANGE: Redesigned the key character map format to
accomodate full keyboards with more comprehensive suite of modifiers.
Old key character maps will not work anymore and must be updated.
The new format is plain text only and it not compiled to a binary
file (so the "kcm" tool will be removed in a subsequent check-in).

Added FULL keyboard type to support full PC-style keyboards.

Added SPECIAL_FUNCTION keyboard type to support special function
keypads that do not have any printable keys suitable for typing
and only have keys like HOME and POWER

Added a special VIRTUAL_KEYBOARD device id convention that maps
to a virtual keyboard with a fixed known layout. This is designed
to work around issues injecting input events on devices whose
built-in keyboard does not have a useful key character map (ie.
when the built-in keyboard is a special function keyboard only.)

Modified several places where events were being synthesized
to use the virtual keyboard.

Removed support for the "qwerty" default layout.
The new default layout is "Generic". For the most part "qwerty"
was being used as a backstop in case the built-in keyboard did
not have a key character map (probably because it was a special
function keypad) and the framework needed to be able to inject
key events anyways. The latter issue is resolved by using the
special VIRTUAL_KEYBOARD device instead of BUILT_IN_KEYBOARD.

Added the concept of a key modifier behavior so that
MetaKeyKeyListener can distinguish between keyboards that use
chorded vs. toggled modifiers.

Wrote more robust key layout and key character map parsers
to enable support for new keyboard features and user installable
key maps.

Fixed a bug in InputReader generating key ups when keys
are released out of sequence.

Updated tons of documentation.

Currently QwertyKeyListener is being used for full keyboards
with autotext and capitalization disabled. This mostly works
but causes some problems with character pickers, etc.
These issues will be resolved in subsequent changes.

Change-Id: Ica48f6097a551141c215bc0d2c6f7b3fb634d354
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
4198918eed8e44723417fad8a986cda664c92d5b 23-Sep-2010 Amith Yamasani <yamasani@google.com> Fix for IndexOutOfBounds in setComposingRegion.

Bug: 3000457

Check upper and lower bounds of the composing region and clip them.

Change-Id: I8128a2b581ce3d8a9ff6c71cc648c3e87163b3f5
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
a90b7f0125389b9e1040d2be82aad4ef74ea6071 26-Aug-2010 Amith Yamasani <yamasani@google.com> Add methods to InputConnection: setComposingRegion() to select a region of text for correction, and getSelectedText()
to return the selected text.

setComposingRegion:

The TextView may choose to highlight the text in some way (underline for now) to indicate
that the text is selected for correction, if the IME wants to provider alternatives.

Choosing an alternative in the IME can then call IC.commitText() to replace the highlighted
(not selected) text with a different candidate.

This change also ensures that any existing spans/styles are not wiped out. So we can now
correct rich text as well.

getSelectedText:

This is a convenience to get the selected text instead of using extracted text that is
more heavy weight. Existing getTextBeforeCursor() and getTextAfterCursor() fail to
retrieve the selected text, only what's before and after the selection.

Change-Id: Ieb5ecd5ff947ea04958589f501e7bd5228e00fb5
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
1127895fd42111f95fdc5049141c512e60198292 09-Mar-2010 Eric Fischer <enf@google.com> Guard against calls to getTextAfterCursor() in text that has no cursor.

Act like the cursor is at 0 in this case instead of crashing.

Bug 2497485

Change-Id: I5ce9b83b323d895e3be75e3133ff2f8e33cc203d
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
86d56cca9ce23b0f4814418d7c71ec11ea9fd278 29-Jun-2009 Dianne Hackborn <hackbod@google.com> Generate key events for actions sent to generic input connections.

There is a compatibility issue with the cupcake IME where the generic
input connection would just consume actions. Late in cupcake this
stuff was reworked so that the IME would send an action command
to the app instead of an enter key event, and the compatibility code
got lost.
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
a465a170ce5d7155580fd308d1e50092365117e4 22-Jun-2009 Dianne Hackborn <hackbod@google.com> Fix bugs 1827027, 1808979, 1820700.

These are all variations of needing to validate ranges on editing operations
coming from the IME, to account for the underlying text changing (usually being
deleted) asynchronously with the IME.
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
1bf5e22da72b477c8b7a45ed85a4dba94be39db5 25-Mar-2009 Dianne Hackborn <> Automated import from //branches/donutburger/...@141001,141001
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54 09-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@137197
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
076357b8567458d4b6dfdcf839ef751634cd2bfb 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@132589
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
3dec7d563a2f3e1eb967ce2054a00b6620e3558c 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@137055
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
3001a035439d8134a7d70d796376d1dfbff3cdcd 19-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@132276
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
da996f390e17e16f2dfa60e972e7ebc4f868f37e 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
b798689749c64baba81f02e10cf2157c747d6b46 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/android/view/inputmethod/BaseInputConnection.java