History log of /frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3dd5fbc569ac67f34e887da5d101e5984ade3945 23-Feb-2017 Yohei Yukawa <yukawa@google.com> Fix an unintentional switch-case fall-through

This is a follow up CL to my previous CL [1], which introduced a
classical fall through bug due to a missing return statement.

[1]: Ic614f112f960382280acd8891b3af56d47679f08
ce82eb2d865e5ee1b69705ca7a0aedd0e92d0d4e

Test: Manually made sure that calling
InputConnection#performPrivateCommand() no longer causes
IllegalStateException("Already recycled.").
Bug: 35079353
Fixes: 35681994
Change-Id: I9aa3c0497385e053718d829aad49495771b22b59
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
ce82eb2d865e5ee1b69705ca7a0aedd0e92d0d4e 13-Feb-2017 Yohei Yukawa <yukawa@google.com> Rely on com.android.internal.os.SomeArgs

Before introducing new state tracking IDs to IInputConnectionWrapper,
this CL cleans up IInputConnectionWrapper to use
com.android.internal.os.SomeArgs instead of local-defined one in favor
of possible performance improvement thanks to the process grobal
object pool that com.android.internal.os.SomeArgs has.

This is a mechanical refactoring CL. No behavior change is intended.
Test: No new warnings in `adb logcat` from the following TAGs
- IInputConnectionWrapper
- InputMethodManager
- InputMethodManagerService
- InputMethodService
Bug: 35079353
Change-Id: Ic614f112f960382280acd8891b3af56d47679f08
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
77e51831a448b03cbeeea8ea286b1d584dca74d4 13-Feb-2017 Yohei Yukawa <yukawa@google.com> Hide logspam due to redundant finishComposingText

Currently we see two warning messages
"finishComposingText on inactive InputConnection"
"finishComposingText on inactive InputConnection"
every time every time the View focus is switched from one EditText
to another EditText on the same window, which is really spammy.

This is actually not critical if IInputConnectionWrapper was already
finished, because with my previous CL [1] it is guaranteed that
InputConnection#finishComposingText() was already called followed by
InputConnection#closeConnection(), which means that the connection
is closed and should not accept any further requests. Thus ignoring
further #finishComposingText() only means that the system and/or IME
is calling #finishComposingText() unnecessarily, which is worth
showing spammy warnings in production builds.

To reduce logspam this CL hides warnings from the above case behind
DEBUG flag.

[1]: If2a03bc84d318775fd4a197fa43acde086eda442
aaa38c9f1ae019f0fe8c3ba80630f26e582cc89c

Test: Make sure `adb logcat -s IInputConnectionWrapper:*` does not
show "finishComposingText on inactive InputConnection" warnings
while switching focus across different EditText on the same
window.
Bug: 35079353
Bug: 35301295
Change-Id: I17f3a4f500bc19ebf8bae771bf658a93627b3ba3
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
2bc66171cce4d5ae7bee2c3920e82e45a9d245af 08-Feb-2017 Yohei Yukawa <yukawa@google.com> Eliminate out-of-sync IMM#mFullscreenMode error

As explained in the commit message of my previous CL [1], we have
had a design issue in how to notify the full-screen mode change
from the IME to InputMethodManager running in the target application.

Histrically we have done this by using hooking the following IPC
from the IME to the target application.

InputConnection#reportFullscreenMode()

However, since we also want InputConnection to be deactivated in some
situations such as the when the target application is no longer
focused. In other words, InputConnection is not a reliable way to
notify something.

As a result, we have suffered from many stale state issues.
Bug 21455064 and Bug 28157836 are such examples. In Android N, we
introduced yet another hack to work around those issues, but it is
really time to fix the protocol design instead.

The new strategy is to rely on internal IPCs provided by
InputMethodManager to deliver such critical notifications from one
process to the other. This is actually more natural because our goal
is to make sure that InputMethodManager#isFullscreenMode() always
returns the latest value as long as the caller is the focused
application.

For backword compatibility, applications that are monitoring
this callback should continue working, as InputMethodManager emulates
the previous behavior. However, as updated in JavaDoc, IMEs are no
longer allowed to invoke InputConnection#reportFullscreenMode(),
which should be OK because even on previous releases IMEs should rely on
InputMethodService#updateFullscreenMode() instead.

[1]: Iba184245a01a3b340f006bc4e415d304de3c2696
1544def0facda69c210b0ae64b17394ea2860d39

Fixes: 28406127
Test: Make sure Bug 21455064 is still fixed.
1. Input some words in extract mode.
2. Select a word.
3. Perform copy.
4. Select a word.
5. Rotate the device.
6. Try to select a word.
7. Make sure he word is selected and action mode starts.
Test: Make sure Bug 28157836 is still fixed.
1. Rotate device to landscape mode.
2. Tap on EditText and start full screen extracted mode.
3. Rotate device to portrait mode.
4. Long press to start action mode.
5. Make sure Action mode gets started.
Test: `adb shell dumpsys input_method` to make sure that fullscreen
state is synchronized across the app, IMMS, and the IME.
Change-Id: If23e7c7c265ab3dfb48c2fb6fdb361b17d22c594
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
6b422e287c984c85f8c1406db7d127e82787826e 10-Jan-2017 Yohei Yukawa <yukawa@google.com> Require InputContentInfo.requestPermission()

This CL logically reverts my previous CL [1], which allowed the system
automatically grant a temporary URI permission to the target
application when the IME calls InputConnection#commitContent() with
InputConnection#INPUT_CONTENT_GRANT_READ_URI_PERMISSION.

Based on conversations with application developers who have supported
Commit Content APIs, I concluded that my assumption that automatically
granting the permission without an explicit call of
InputContentInfo.requestPermission() would help application developers
was wrong. They anyway need to take care of the situation where the
app fails to read the data from the given content URI. Thus just
receiving SecurityException() because of not calling it is still one
of such cases that application developers cannot forget about.

Therefore with this CL InputContentInfo.requestPermission() becomes
mandatory when InputConnection#INPUT_CONTENT_GRANT_READ_URI_PERMISSION
is specified.

[1]: Id955435dd2e72549ee7134f46b3c6951581694ad
f3806f57a59ede663f3fa2ad1f5080bdbf20e372

Bug: 32315394
Test: By github.com/googlesamples/android-CommitContentSampleApp
Change-Id: I8a3cb79ae6d6c4113914734799b21bfc96e3ca3e
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
93278ca144bef7d8af7a014e278f552da1fcb38c 14-Oct-2016 Yohei Yukawa <yukawa@google.com> Handle exceptions from #requestPermission()

This is a follow up CL to my previous CL [1] that let
IInputConnectionWrapper to call InputContentInfo#requestPermission()
automatically so that temporary URI permissions can be granted
automatically on API 25+ devices whenever
INPUT_CONTENT_GRANT_READ_URI_PERMISSION is specified.

However, in that CL we forgot to handle exceptions thrown from
InputContentInfo#requestPermission(). This is problematic because it is
actually easy for IMEs to cause SecurityException by specifying a
content URI that does not allow grantUriPermission, e.g.:

inputConnection.commitContent(
new InputContentInfo(Uri.parse("content://call_log/test"),
new ClipDescription("test", new String[]{"image/gif"}));

As a result, IMEs can let the application crash at any time because
InputContentInfo#requestPermission() is automatically called inside the
Framework.

This CL makes sure that exceptions thrown from
InputContentInfo#requestPermission() can be handled gracefully.

[1]: Id955435dd2e72549ee7134f46b3c6951581694ad
f3806f57a59ede663f3fa2ad1f5080bdbf20e372

Bug: 32162481
Change-Id: I08916a1f54518390d3b67ab1673dc901e3f9716a
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
f3806f57a59ede663f3fa2ad1f5080bdbf20e372 01-Jul-2016 Yohei Yukawa <yukawa@google.com> Automatically grant URI permission as needed.

With this CL, the system automatically grants a temporary URI permission
to the target application when the IME calls
InputConnection#commitContent() with
InputConnection#INPUT_CONTENT_GRANT_READ_URI_PERMISSION. The temporary
permission will be revoked by any of the following events:
- InputContentInfo#releasePermission() is explicitly called by the
target application.
- The target application returned false in
InputConnection#commitContent().
- All the InputContentInfo instances copied from the original one are
GC-ed.

If we do not do this and there is an application that forgot to call
that method then there is no way for IME developers to prevent
permission denial from happening in the application except for relaxing
the default permission of the ContentProvider just because of such an
application.

Although application developers are still expected to explicitly call
InputContentInfo#{request,release}Permission(), forgetting to call
InputContentInfo#requestPermission() does not hurt the user anymore.

With this CL, calling InputContentInfo#requestPermission() after calling
InputContentInfo#releasePermission() is also allowed.

Bug: 29892936
Change-Id: Id955435dd2e72549ee7134f46b3c6951581694ad
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.java
1544def0facda69c210b0ae64b17394ea2860d39 27-Apr-2016 Yohei Yukawa <yukawa@google.com> Fix stale InputMethodManager#mFullscreenMode.

The current mechanism to sync InputMethodService#mIsFullscreen to
InputMethodManager#mFullscreenMode is really fragile because
1. Currently the state change is notified via
InputConnection#reportFullscreenMode(), where InputConnection is
designed to be valid only while the IME has input focus to the
target widget.
2. In favor of performance InputMethodService (IMS) calls
InputConnection#reportFullscreenMode() only when #mIsFullscreen
changed. If InputConnection#reportFullscreenMode() failed, there
is no recovery mechanism.
3. Screen oriantation change is likely to cause Window/View focus
state change in the target application, which is likely to
invalidate the current InputConnection.

What our previous workaround [1] did for Bug 21455064 was actually
relaxing the rule 1 only for InputConnection#reportFullscreenMode().
However, my another CL [2] made the lifetime check of InputConnection a
bit more strict again, which revived the issue as Bug 28157836.

Probably a long-term fix would be to stop using InputConnection to sync
that boolean state between IMS and the application. However, it's too
late to do such a refactoring in N, hence this CL relaxes the rule 1
again keeping it as secure as possible.

The idea is that we allow InputConnection#reportFullscreenMode() to
update InputMethodManager#mFullscreenMode regardless of whether
InputConnection is active or not, as long as the InputConnection is
bound to the curent IME. Doing this as a short-term solution is
supporsed to not introduce any new risk because the active IME is
already able to mess up the InputMethodManager#mFullscreenMode by
calling InputConnection#reportFullscreenMode() on any other active
InputConnection. Bug 28406127 will track the long-term solution.

[1]: Id10315efc41d86407ccfb0a2d3956bcd7c0909b8
da589dffddaf4046d3b4fd8d14d5f984a1c4324a
[2]: If2a03bc84d318775fd4a197fa43acde086eda442
aaa38c9f1ae019f0fe8c3ba80630f26e582cc89c

Bug: 28157836
Change-Id: Iba184245a01a3b340f006bc4e415d304de3c2696
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.java
223db8b6f5a6be51eac16d1f38cf01e4466a4233 24-Mar-2016 Yohei Yukawa <yukawa@google.com> Revert "Remove redundant IMM#mServedInputConnection."

This reverts commit afb6558c8f5e0ee797b252558d7e529e3d946d8f.

It turns out that this CL caused a serious regression Bug 27824691.

Bug: 25332806
Bug: 27824691
Change-Id: I16312592743a6673449c492ee5ba533256d343ea
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.java
afb6558c8f5e0ee797b252558d7e529e3d946d8f 23-Mar-2016 Yohei Yukawa <yukawa@google.com> Remove redundant IMM#mServedInputConnection.

Following two fields have basically the same lifetime.
- InputMethodManager#mServedInputConnection
- InputMethodManager#mServedInputConnectionWrapper
Hence we do not need to maintain both of them.

This is a preparation CL for Bug 25332806 and does not change any
user-visible behavior.

Bug: 25332806
Change-Id: I1181e067aa5bedbdf0c7ec1bcec479257aea511c
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
ac3e599069e1b87ea190f008aef60a506c8561c7 18-Jan-2016 Yohei Yukawa <yukawa@google.com> Merge "Introdude IC#deleteSurroundingTextInCodePoints()."
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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.java
da589dffddaf4046d3b4fd8d14d5f984a1c4324a 17-Jun-2015 Andrei Stingaceanu <stg@google.com> Cannot select text after rotation in extract mode

The InputConnection did not report the fullscreen mode to
the InputMethodManager if the connection was not active
which ended up feeding the Editor false information about
when extracted mode will be started.

Bug: 21455064
Change-Id: Id10315efc41d86407ccfb0a2d3956bcd7c0909b8
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.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/com/android/internal/view/IInputConnectionWrapper.java
15a4d2ffd04dc6c70f2cd17dae12ac6bc14c69ab 12-Mar-2010 Kenny Root <kroot@google.com> Add correct copyright headers to multiple files

Format for the list of changes shows the origin commit reference followed
by the file name.

33931-p9 awt/org/apache/harmony/awt/gl/font/AndroidGlyphVector.java
33931-p9 awt/org/apache/harmony/awt/gl/image/PngDecoderJava.java
133776-p9 core/java/android/app/IntentService.java
127013-p9 core/java/android/appwidget/AppWidgetHost.java
27863-p9 core/java/android/bluetooth/BluetoothAudioGateway.java
60765-p9 core/java/android/content/SyncResult.java
43920-p9 core/java/android/content/pm/ActivityInfo.java
43920-p9 core/java/android/content/pm/ApplicationInfo.java
43920-p9 core/java/android/content/pm/InstrumentationInfo.java
43920-p9 core/java/android/content/pm/PackageInfo.java
44103-p9 core/java/android/content/pm/PackageItemInfo.java
68960-p9 core/java/android/content/pm/PackageStats.java
43920-p9 core/java/android/content/pm/ResolveInfo.java
43920-p9 core/java/android/content/pm/ServiceInfo.java
60641-p9 core/java/android/content/res/Configuration.java
60734-p9 core/java/android/content/res/TypedArray.java
137672-p9 core/java/android/inputmethodservice/ExtractButton.java
123112-p9 core/java/android/inputmethodservice/ExtractEditText.java
119291-p9 core/java/android/inputmethodservice/IInputMethodSessionWrapper.java
112946-p9 core/java/android/inputmethodservice/IInputMethodWrapper.java
115078-p9 core/java/android/os/BatteryStats.java
124790-p9 core/java/android/text/style/UpdateAppearance.java
45083-p9 core/java/android/view/RawInputEvent.java
101491-p9 core/java/android/view/inputmethod/EditorInfo.java
114701-p9 core/java/android/view/inputmethod/ExtractedText.java
123112-p9 core/java/android/view/inputmethod/ExtractedTextRequest.java
119291-p9 core/java/com/android/internal/os/HandlerCaller.java
129279-p9 core/java/com/android/internal/os/PkgUsageStats.java
114701-p9 core/java/com/android/internal/view/IInputConnectionWrapper.java
114701-p9 core/java/com/android/internal/view/InputConnectionWrapper.java
84364-p9 opengl/java/android/opengl/EGLLogWrapper.java
11355-p9 opengl/tools/glgen/src/CFunc.java
11355-p9 opengl/tools/glgen/src/CType.java
11355-p9 opengl/tools/glgen/src/CodeEmitter.java
11355-p9 opengl/tools/glgen/src/GenerateGL.java
11355-p9 opengl/tools/glgen/src/JFunc.java
11355-p9 opengl/tools/glgen/src/JType.java
11355-p9 opengl/tools/glgen/src/JniCodeEmitter.java
11355-p9 opengl/tools/glgen/src/ParameterChecker.java
57236-p9 services/java/com/android/server/status/AnimatedImageView.java
66754-p9 services/java/com/android/server/status/CloseDragHandle.java
57188-p9 services/java/com/android/server/status/DateView.java
46928-p9 services/java/com/android/server/status/ExpandedView.java
70590-p9 services/java/com/android/server/status/FixedSizeDrawable.java
45968-p9 services/java/com/android/server/status/IconData.java
57470-p9 services/java/com/android/server/status/IconMerger.java
82719-p9 services/java/com/android/server/status/LatestItemView.java
45968-p9 services/java/com/android/server/status/NotificationData.java
66754-p9 services/java/com/android/server/status/NotificationLinearLayout.java
57458-p9 services/java/com/android/server/status/NotificationViewList.java
45968-p9 services/java/com/android/server/status/StatusBarException.java
45968-p9 services/java/com/android/server/status/StatusBarIcon.java
46130-p9 services/java/com/android/server/status/StatusBarNotification.java
45968-p9 services/java/com/android/server/status/StatusBarView.java
46199-p9 services/java/com/android/server/status/Ticker.java
62286-p9 services/java/com/android/server/status/TickerView.java
57188-p9 services/java/com/android/server/status/TrackingView.java
86041-p9 telephony/java/android/telephony/PhoneStateListener.java
87020-p9 telephony/java/com/android/internal/telephony/TelephonyIntents.java
136269-p9 telephony/java/com/android/internal/telephony/gsm/SpnOverride.java
34409-p9 tests/FrameworkTest/src/com/android/frameworktest/FrameworkTestApplication.java
55717-p9 tests/FrameworkTest/src/com/android/frameworktest/performance/InvalidateCycle.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScan.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResize.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScan.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollableResize.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java
127341-p9 tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java
129347-p9 tests/ImfTest/src/com/android/imftest/samples/DialogActivity.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/EditTextActivityDialog.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java
25959-p9 tests/framework-tests/src/android/test/FrameworkTests.java
46162-p9 tests/framework-tests/src/com/android/internal/http/multipart/MultipartTest.java
77101-p9 tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/NinePatchTest.java
9788976b1465ce982b5ae7c741345edd0ecd9322 core/java/android/accounts/AuthenticatorDescription.java
53332883543868fb83e111a07306368b7772b340 core/java/android/app/UiModeManager.java
93e7e22ec91dbc641d10ca6d70423e1357a95bba core/java/android/app/FullBackupAgent.java
328c0e7986aa6bb7752ec6de3da9c999920bb55f core/java/android/content/CursorEntityIterator.java
307da1a46b4c9b711bafe8fbaaa6b98e8868c18e core/java/android/content/SyncQueue.java
307da1a46b4c9b711bafe8fbaaa6b98e8868c18e core/java/android/content/SyncOperation.java
eb034652c2037a47ebfd99779e8383bb8bb528af core/java/android/content/pm/LabeledIntent.java
49237345d83e62fdb9eb8d50b13ad086636a04fa core/java/android/content/pm/FeatureInfo.java
a2b6c3775ed6b8924232d6a01bae4a19740a15f8 core/java/android/content/pm/PackageInfoLite.java
3ecd5f437580e49d80beecd29489d5fb1f7a7db0 core/java/android/content/pm/RegisteredServicesCacheListener.java
5ebbb4a6b3e16f711735ae0615b9a9ea64faad38 core/java/android/content/pm/XmlSerializerAndParser.java
c4516a7b62de525e3d6d5e76851bdfaf12c11f05 core/java/android/database/sqlite/SQLiteTransactionListener.java
9bbc21a773cbdfbef2876a75c32bda5839647751 core/java/com/android/internal/backup/LocalTransport.java
21f1bd17b2dfe361acbb28453b3f3b1a110932fa core/java/com/android/internal/content/PackageMonitor.java
4c62fc0e1e5ea9c69a12a7d1cf8b3ec8b2d114a3 core/java/com/android/internal/view/BaseSurfaceHolder.java
4c62fc0e1e5ea9c69a12a7d1cf8b3ec8b2d114a3 core/java/com/android/internal/view/BaseIWindow.java
e540833fdff4d58e37c9ba859388e24e2945ed45 core/java/com/android/internal/os/SamplingProfilerIntegration.java
192ab903887bbb8e7c7b6da5c581573850e30f46 core/tests/coretests/src/android/widget/expandablelistview/PositionTesterContextMenuListener.java
1619367ab823150fa8856d419abe02ceb75886f1 media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java
27f8002e591b5c579f75b2580183b5d1c4219cd4 opengl/tools/glgen/stubs/gles11/glGetString.java
560814f6b11abe83ff0c4ed18cac015c276b3181 opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.java
560814f6b11abe83ff0c4ed18cac015c276b3181 opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.java
560814f6b11abe83ff0c4ed18cac015c276b3181 opengl/tools/glgen/stubs/gles11/glShaderSource.java
1c4907ee77392afb768c2f088e0dedbe4239f6fb opengl/tools/glgen/src/GenerateGLES.java
1c4907ee77392afb768c2f088e0dedbe4239f6fb opengl/tools/glgen/src/Jsr239CodeEmitter.java
1c4907ee77392afb768c2f088e0dedbe4239f6fb opengl/tools/glgen/src/GLESCodeEmitter.java
69e21f5f6e0d04539cd92848ea009dd615d88c2c opengl/tests/gldual/src/com/android/gldual/TriangleRenderer.java
c028be4f3b8c7476b46859f66c3f33d528adf181 packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
7c6efa13f129dbae5319f0981a430d4662f43354 tests/BrowserPowerTest/src/com/android/browserpowertest/PowerMeasurement.java
7c6efa13f129dbae5319f0981a430d4662f43354 tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestActivity.java
7c6efa13f129dbae5319f0981a430d4662f43354 tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestRunner.java
df8a3f31d871db25e952972c2eb346a71186e9e3 tests/BrowserTestPlugin/src/com/android/testplugin/TestPlugin.java
cfaef699e1dfb3a75d5b51f3b15816f13670fd51 tests/permission/src/com/android/framework/permission/tests/ActivityManagerPermissionTests.java
cfaef699e1dfb3a75d5b51f3b15816f13670fd51 tests/permission/src/com/android/framework/permission/tests/ServiceManagerPermissionTests.java
cfaef699e1dfb3a75d5b51f3b15816f13670fd51 tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java

Copyright header moved to top in following file:

core/tests/coretests/src/android/widget/ListViewTest.java

Change-Id: I3c3198be5a0ba36e18679ed834170432bf0b8418
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
076357b8567458d4b6dfdcf839ef751634cd2bfb 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@132589
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
3dec7d563a2f3e1eb967ce2054a00b6620e3558c 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@137055
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
3001a035439d8134a7d70d796376d1dfbff3cdcd 19-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@132276
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
da996f390e17e16f2dfa60e972e7ebc4f868f37e 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
f1e484acb594a726fb57ad0ae4cfe902c7f35858 22-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@127436
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
b798689749c64baba81f02e10cf2157c747d6b46 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java