4397591f3da2aa03a22eeca308a78e1027505228 |
|
03-Mar-2018 |
Yohei Yukawa <yukawa@google.com> |
Revert "Introduce InputConnection#reportLanguageHint()" This reverts commit e77386e8fbe01b7fbf1a04555d4088796d862f03 [1]. Reason for revert: The protocol is not yet ready to be exposed and we are still unsure what is the best approach. [1]: Ie86edafd1ed68b58f702116f561fc448fdbb57a8 Bug: 7031513 Bug: 72522601 Fix: 74087970 Test: atest CtsInputMethodTestCases Change-Id: Ia61dc9b3d5b116199382994430fb16ee804942b3
/frameworks/base/core/java/com/android/internal/view/InputConnectionWrapper.java
|
e77386e8fbe01b7fbf1a04555d4088796d862f03 |
|
23-Jan-2018 |
Yohei Yukawa <yukawa@google.com> |
Introduce InputConnection#reportLanguageHint() The goal of this CL is to introduce a way for IMEs to tell applications about what languages are likely to be used in the text to be committed, for IMEs that support dynamic language switching (especially without relying on InputMethodSubtype). It is already obvious that InputMethodSubtype is not working well for this use case. We need is a simple, easy, and back-portable way that can be widely accepted by the ecosystem. Bug: 7031513 Test: atest CtsInputMethodTestCases Change-Id: Ie86edafd1ed68b58f702116f561fc448fdbb57a8
/frameworks/base/core/java/com/android/internal/view/InputConnectionWrapper.java
|
1d113d041f113feabe0ff4cc57205fe8876b9e0b |
|
13-Oct-2017 |
Tarandeep Singh <tarandeep@google.com> |
Skip blocking InputConnection APIs after unbind InputConnectionWrapper has several synchronous methods which have a timeout. If the application's UI thread hangs, all these synchronous methods are blocked and IME stays on-screen. This CL aims to improve the responsiveness of IMEs by rejecting any blocking calls of InputConnection APIs once IInputMethod#unbindInput() is issued by InputMethodManagerService (IMMS). Currently #unbindInput() is issued only from IMMS#unbindCurrentClientLocked(), which basically means that the previous application is losing the IME focus. Underlying #onUnbindInput() signal is still immediately delivered to the IME process, but it's just waiting to be consumed on the UI thread. Hence in theory we can change the behavior of InputConnection seen from the IME once the signal is delivered to the IME process. This CL does not interrupt already blocked API calls, which is one of future work for this scenario. This CL relies on: A. IInputMethod is marked as oneway B. IMMS guarantees that IInputMethod#bindInput() and IInputMethod#unbindInput() are always paired without nesting, and IInputMethod#startInput() is called 0 or more times only during that pair. In this case, the system guarantees that IInputMethod methods will be called back in the IME process in the same order, and only one IPC thread is handling those IPCs at the same time. See the JavaDoc of IBinder#FLAG_ONEWAY for details. Bug: 36897707 Test: Manual: using the apk in the linked bug: 1. Make sure that a valid InputConnection is established between the test app and a test IME. 2. Let the test app start blocking the UI thread. 3. Let the test IME call InputConnection#getTextBeforeCursor() three times. 4. Tap the Home button on the NavBar. 5. Make sure that the test app is immediately dismissed. 6. Make sure that InputConnection#getTextBeforeCursor() starts returning immediately, once after the initial call was timed- out after 2 sec (InputConnectionWrapper#MAX_WAIT_TIME_MILLIS) Change-Id: I0f816c6ca4c5c0664962432b913f074605fedd27
/frameworks/base/core/java/com/android/internal/view/InputConnectionWrapper.java
|
930328ca97bd1ea6e1d56743712fb937492c34b7 |
|
19-Oct-2017 |
Yohei Yukawa <yukawa@google.com> |
Annotate threads for some IME handling methods This is a preparation to work on Bug 36897707. For instance, the reason why most of IME-related callbacks in InputMethodService get called on the main thread is because IInputMethodWrapper keeps forwarding incoming IPCs into the main looper of the IME process as follows: InputMethodManagerService (IMMS) ------ -> one-way binder IPCs over IInputMethod ------ -> IInputMethodWrapper (on the binder thread(s)) -> Handler (to dispatch tasks to main thread) -> InputMethodImpl.* (on the main thread) -> InputMethodService.* (on the main thread) By adding explicit annotations such as @BinderThread and @MainThread in relevant methods, this CL makes that kind of investigation much easier than before. Bug: 36897707 Test: compile Change-Id: I8f9afe9a1986a9fa41fb66fdc64e8f0f67e45c2e
/frameworks/base/core/java/com/android/internal/view/InputConnectionWrapper.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/InputConnectionWrapper.java
|
79d1c75a3f774bd8c4742f9d7bbd29161c3f1f68 |
|
30-Jun-2016 |
Yohei Yukawa <yukawa@google.com> |
Revert "Remove InputContentInfo#requestPermission()" This reverts commit c4b8f36de5523366e354fc01b6cba81ad72f6423. Having InputContentInfo#requestPermission() should not hurt developers, but we can polish the behavior in a subsequent CL without changing the API. Bug: 29450031 Bug: 29892936 Change-Id: I1b43c19417b643d0c269af860db2d309b73a90d5
/frameworks/base/core/java/com/android/internal/view/InputConnectionWrapper.java
|
c4b8f36de5523366e354fc01b6cba81ad72f6423 |
|
30-Jun-2016 |
Yohei Yukawa <yukawa@google.com> |
Remove InputContentInfo#requestPermission() It turns out that requiring editor authors to call InputContentInfo#requestPermission() as needed is just confusing and can cause compatibility issues, because if an editor author forgot to call that method then there would be no way for IME developers to prevent permission denial except for relaxing the default permission of the ContentProvider just because of such an application. This is not what we want to see. My conclusion is that the system should automatically call InputContentInfo#requestPermission() (or do any equivalent operation) when InputConnection#INPUT_CONTENT_GRANT_READ_URI_PERMISSION is specified, like we have done in Context#startActivity(). 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, and 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. Bug: 29450031 Bug: 29892936 Change-Id: I37fb744e4d3d1c59177fb0a9be4ef5c325c9a39f
/frameworks/base/core/java/com/android/internal/view/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.java
|
19a80a1e807acd00bec999eaac7812da6ffce954 |
|
15-Mar-2016 |
Yohei Yukawa <yukawa@google.com> |
Tell IMS about missing InputConnection methods. Summary: This CL introduces a unified mechanism to deal with the situation where the application directly implements InputConnection but some of methods are not implemented. Note that there should be zero overhead when the application extends BaseInputConnection or InputConnectionWrapper. Background: When ever we add a new method to InputConnection, there has been a risk that existing applications that directly implement InputConnection can get java.lang.AbstractMethodError exception at runtime, because older SDKs do not require the application developer to implement the methods that are newly added in later SDKs. Because of this we strongly discouraged developers to directly implement InputConnection interface, and encouraged them to subclass BaseInputConnection or InputConnectionWrapper instead. That said, as requested in Bug 26945674, there is a certain demand to be able to implement InputConnection without depending on BaseInputConnection. The goal of this CL is to provide a reliable and sustainable solution to above missing method scenario in InputConnection. One of the reasons why dealing with missing InputConnection methods is so difficult is that what InputMethodService receives to communicate with the target application is actually a proxy class com.android.internal.view.InputConnectionWrapper that runs in the IME process and immediately returns true for most of methods in InputConnection such as #commitText() and #finishComposingText(). Because of this asynchronous nature, it is too late to change the actual return value that the IME receives when the application receives those one-way asynchronous IPC calls. Solution: To handle those cases, this CL checks the availability of InputConnection methods that did not exist in the initial release before the target application calls startInput(), and let the application to send its availability bits to IMMS so that InputConnectionWrapper running in the IME process can be initialized with such availability bits. Note that we do know that BaseInputConnection and its subclasses support all the InputConnection methods, hence for most of applications we can just assume that all the methods are available without reflection. With such availability bits, InputConnectionWrapper is now able to gracefully return failure code to the IME because the availability of those methods is immutable, except for a tricky case where the application relies on a proxy object that dynamically changes the dispatch target. Here is the list of APIs that we start checking the availability in this CL. [API Level 9+] - InputConnection#getSelectedText(int) - InputConnection#setComposingRegion(int, int) [API Level 11+] - InputConnection#commitCorrection(CorrectionInfo) [API Level 21+] - InputConnection#requestCursorUpdates(int)} [API Level 24+] - InputConnection#deleteSurroundingTextInCodePoints(int, int) - InputConnection#getHandler() Ideas alternatively considered: Default methods in InputConnection We once considered having default methods in InputConnection but abandoned this idea because it does not directly solve the problem about how to tell the that the API does not take effect. Also having default methods would make it difficult for application developers to be aware of newly added methods in InputConnection. Bug: 27407234 Bug: 27642734 Bug: 27650039 Change-Id: I3c58fadd924fad72cb984f0c23d3099fd0295c64
/frameworks/base/core/java/com/android/internal/view/InputConnectionWrapper.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/com/android/internal/view/InputConnectionWrapper.java
|
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/InputConnectionWrapper.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/com/android/internal/view/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/com/android/internal/view/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.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/InputConnectionWrapper.java
|