By default all PhoneWindows use Theme_windowAnimationStyle which
animates window up and down when gaining and losing focus respectively.
For InkWindow we don't need any animation.
Fix: 237331144
Fix: 245441579
Bug: 253477462
Test: atest StylusHandwritingTest
Change-Id: I209b03dfbed386a2863921b49d43858037d380b8
Mark DISALLOW_INPUT_METHOD_INTERFACE_OVERRIDE
comapt change ID as TestApi for CTS testing.
Bug: 148086656
Test: presubmit
Change-Id: I7b56d68cb5429c7076943f3d12b1d19cdf54d26a
This CL mechanically moves RemoteInputConnectionImpl from
com.android.internal.inputmethod
to
android.view.inputmethod
just to make it a package-private class, as it is (and should be) used
only by InputMethodManager.
This is a mechanical refactoring. There must be no developer
observable behavior change in this CL.
Bug: 192412909
Test: presubmit
Change-Id: I2d9bd4a5cb39d506a70331c9c930a74580cdbfa0
After stylus hasnt been used for handwriting in last X minutes,
remove the the stylus handwriting window.
Bug: 243571274
Test: StylusHandwritingTest
Change-Id: I641be63e028ea9cbfd882ce318d30aad71fd8a4e
With [1] we changed the lifecycle of InkWindow to be short lived and
missed certain cases.
This also fixes CTS testStylusSession_fingerTriggersNavbarGestures
Bug: 243571274
Test: atest StylusHandwritingTest
[1]: Icd3eea91fe144cff7100d3ecf19191c064c0d196
This is a retry for I1593ff10a5520aadb5ed86a4a09f2405ee65c321
Change-Id: Ibf54599f41ac13121215c5344eb92ecca3259db1
It had the chance for calling into IMS but IMS
already destroyed.
Ideally we should suppress any callbacks after
InputMethodService#onDestroy() and log them.
First try is CL[1], but it wrongly add the API to
IInputMethod. Using the InputMethodServiceInternal
is make more sense for IInputMethodWrapper to
communicate with InputMethodService.
[1]: I10f26a92e739b60c5b8010e8476f8f5a403e0a7b
Bug: 121269861
Bug: 211062619
Bug: 148086656
Test: presubmit
Change-Id: I7b4f34eb38f44dea6872eb46866c9ad7dc1c185c
Add InputConnecton#replaceText(int, int, CharSequence, int, TextAttribute) API to support replacing the specific range in the editor with suggested text.
Add default implementation in InputConnection which delegates to call
finishComposingText()+setSelection()+commitText().
Add implementation in BaseInputConnection which will address the issue
of selection flash.
Bug: 241503197
Test: atest FrameworksCoreTests:BaseInputConnectionTest
Test: atest CtsInputMethodTestCases:BaseInputConnectionTest
Change-Id: Ia0e42270cfae112fcf19205a7151e4ab4ac4afdd
Add a compatibility change to forbit IMEs to override
the deprecated onCreateInputMethodSessionInterface
method from U.
Bug: 148086656
Test: presubmit
Change-Id: I002c895ce977cf7ed4ef40019c831ccbd9b6450d
IME developers have no strong reason to override
InputMethodImpl and InputMethodSessionImpl methods.
Add deprecated annotation to these methods with
suggested alternatives.
Bug: 148086656
Test: presubmit
Change-Id: I4e970404a1cbf15d6b40760b7808825c0eb94736
Add new APIs for select and delete with two rectangles.
Test: atest InputConnectionEndToEndTest
Test: atest StylusHandwritingest
Bug: 239783077
Change-Id: Ia7240d3eaac8610c774c3a4aad074a4b84b71521
It had the chance for calling into IMS but IMS
already destroyed.
Ideally we should suppress any callbacks after
InputMethodService#onDestroy() and log them.
Bug: 121269861
Bug: 211062619
Bug: 148086656
Test: presubmit
Change-Id: I10f26a92e739b60c5b8010e8476f8f5a403e0a7b
performHandwritingGesture should take an optional IntConsumer
& executor to provide result of Gesture operation back to IME.
Bug: 210039666
Bug: 239783077
Test: atest InputConnectionEndToEndTests
Change-Id: I2ca7eaa182159b7ffef0812d970512ffcf817ce2
API feedback:
1. use IntDef for toolType
2. Add javadoc in onUpdateEditorTooltip describing its called after
onStartInput.
Fix: 241206150
Bug: 233108064
Test: atest CtsInputMethodTestCases
Change-Id: I95bccd992690af5c160277b88a854d8f032278aa
1. When the system removes the last known stylus device
and has no other stylus available, remove the Ink window.
2. Create InkWindow only if the device+IME combination supports
handwriting and the stylus is being used.
Bug: 243571274
Bug: 239121683
Bug: 210039666
Test: atest StylusHandwritingTest
Change-Id: Icd3eea91fe144cff7100d3ecf19191c064c0d196
During a stylus handwriting session, user can perform a
stylus gesture operation like Select, delete, insert on an
area of text. IME needs APIs to perform these gestures on text.
This CL introduces API signature for Select, delete, insert gestures.
Design doc: go/scribe-gestures-api
Bug: 239783077
Bug: 210039666
Test: Manually build & compile HandwritingIme
Change-Id: I53bcb62e03ac1c371feb60d1385c88c921754092
Introduce APIs necessary for IMEs to be able to distinguish when to show
virtual keyboard vs companion widget based on toolType.
IME receives click toolType in:
1. IMS#onUpdateEditorToolType(int toolType) for every showSoftInput()
called from IMM.
2. Initial value of toolType in EditorInfo#getInitialToolType().
Fix: 233108064
Bug: 210039666
Test: atest StylusHandwritingTest
Change-Id: I91ea9204ef62697b8942b0f350169382f18b3278
IInputMethod#initializeInternal() is a hot-spot where we keep adding
new parameters recently. Introducing a dedicated parameter object
would allow us to add further parameters with fewer lines of changes.
This is a mechanical refactoring. There should be no developer
observable behavior change.
Bug: 234882948
Test: presubmit
Change-Id: I98a5424385804ec190885ba53973935f9db66b88
IInputMethod#startInput() is a hot-spot where we keep adding new
parameters recently. Introducing a dedicated parameter object would
allow us to add further parameters with fewer lines of changes.
This CL also renames
InputMethod#dispatchStartInputWithToken
to
InputMethod#dispatchStartInput
for consistency.
This is a mechanical refactoring. There should be no developer
observable behavior change.
Bug: 234882948
Test: presubmit
Change-Id: I4a6af9a47db04335921a7d14efe91bfeff25c56d
This CL moves some operations from DO_START_INPUT handler to
IInputMethod#startInput() binder callback, which should be safe
because calling EditorInfo#makeCompatible() and instantiating
RemoteInputConnection are both OK to be done eagerly.
There should be no developer observable behavior change in this CL.
Bug: 234882948
Test: presubmit
Change-Id: I69e8bc5515d09824ed19e68f585590447e130a38
There are several places where EditorInfo is still called "attribute"
in our code base. Let's call them "editorInfo" or something like that
for better readability.
This is just a mechanical code clean-up. There should be no behavior
change and compability concern.
Fix: 237008479
Test: presubmit
Change-Id: Idd147940c34ab5fd39b2d11b2acb1554c7d8f26d
This is a minor follow up CL to our previous CL [1], which migrated
IME to handle back with OnBackInvokedDispatcher.
Having SomeArgs within SomeArgs doesn't make sense unless we really
run out of arguments.
This CL also addresses minor style issues.
Basically this is a mechanical clean-up that has no behavior change.
[1]: Ie207b63b11a56c9b2173f26b734a27b13ebccc60
a6666f2221
Bug: 228358882
Bug: 234882948
Test: presubmit
Change-Id: Ie14f66be0c9d66d221c5f9fae244df5487d65593
When the enableOnBackInvokedCallback is set to false (or not set),
registering an OnBackInvokedCallback should be a no-op to avoid
overriding the default compat callback.
Test: Manual testing registering a callback on an app with the flag
disabled and doing a back gesture. Currently we don't have test
executing a back gesture so automated tests are not possible
Bug: 235206960
Change-Id: I54d843f11130a78ed5a68cbe4722e601a2086ee1
IRemoteInputConnectionInvoker is used only from RemoteInputConnection,
which is already placed under android.inputmethodservice as a
package-private class. Let's also move IRemoteInputConnectionInvoker
to android.inputmethodservice as a package-private class to minimize
its visibility.
This is a mechanical refactoring, which should have no user/developer
observable behavior change.
Bug: 234882948
Test: presubmit
Change-Id: Ie946993aeedc31a67e3074dc591245f75143a9f1
The API allows IME developers to override default system idle-timeout
for stylus handwriting sessions. The system default may be too long or
too short for certain use-cases and it makes sense to let IME change it.
Bug: 233811329
Test: atest StylusHandwritingTest
Change-Id: I9e869658ad57b2ec91b882ab9e003e7f60f95c7c
This CL moves 4 files that match *InlineSuggestions* from
com.android.internal.view
to
com.android.internal.inputmethod
as they are basically used only by IME classes (and Autofill).
Hopefully this gives better code organization and maintainance.
This is a mechanical refactoring of internal details. There should be
no user/developer observable behavior change in this CL.
Bug: 234882948
Test: presubmit
Change-Id: Iac696ae501953ab6a90d99112a62221454cd76e4
This CL Moves IInputMethod from
com.android.internal.view
to
com.android.internal.inputmethod
to be consistent with other IME-related internal files.
This is a mechanical refactoring of internal details. There should be
no user/developer observable behavior change in this CL.
Bug: 234882948
Test: presubmit
Change-Id: I1a43c2ad1f932ecb9201b3958becb475fb2d718d
This CL Moves IInputMethodSession from com.android.internal.view to
com.android.internal.inputmethod to be consistent with other
IME-related files.
This CL also moves IInputSessionCallback to
com.android.internal.inputmethod with renaming it to
IInputMethodSessionCallback for consistency.
This is just a renaming CL of implementation details. There should be
no user/developer observable behavior change in this CL.
Bug: 234882948
Test: presubmit
Change-Id: I87495cbd482dd55005ac8d948f57f32bb016c7d6
IInputContext is the IPC interface name used behind InputConnection,
which was named in the initial development of IME API for Android 1.5.
To make it more descriptive and consistent with other classes such as
RemoteInputConnection, let's rename it to IRemoteInputConnection.
This CL also renames
IInputContextInvoker
to
IRemoteInputConnectionInvoker
for consistency.
This is a rename of internal IPC interface. There should be no
user/developer observable impact.
Bug: 234882948
Test: presubmit
Change-Id: Iae82d5a26f0746161c2bf91a421b97f0f238aafd
switch.
This can happen when one navigates from an activity showing IME
to another activity requesting to show IME. The following sequence would
happen:
- IMM of the current activity receives an UNBIND message with reason CLIENT_SWITCH
- A new IMM is created for the new activity requesting input and
requests to bind.
- The new IMM requests to start input, triggering
IMS#dispatchStartInputWithToken with a *new* ImeOnBackInvokedDispatcher instance than the one previously kept by IMS.
Previously, the ime dispatcher instance was updated before the existing
back callback was unregistered and caused the unregister call to fail.
The fix is to update the dispatcher after the other logic in
IMS#dispatcherStartInputWithToken (specifically, to after startInput(),
which calls doFinishInput() if input is already started).
Bug: 234416098
Test: atest CtsInputMethodTestCases
Change-Id: Ic7a5daab8709b808343388b095b5b6ad40adc777