The case handling DO_SET_STYLUS_WINDOW_IDLE_TIMEOUT was missing
the validation check, which could lead to NullPointerExceptions.
Test: n/a
Bug: 278853086
Change-Id: I998e20df74b618396cfe3b1fa5d7d4e7d13e054c
When a motion event is enqueued into the view root, the view root
expects to own the event, which means it will finish and recycle the
event if necessary.
In the handwriting pipeline, this event actually comes from an
InputEventReceiver that handles finishing the event, so there is a
chance that the event is finished or recycled twice. Make sure the view
root owns the event that is enqueued into it by providing it with a copy
of the event.
Bug: 277809922
Test: manual, HandwritingIme
Change-Id: I65968d075640c1dd585d5d7b9eadb78e3dff9aa2
Here, we do two things:
1. To account for the case where the changed the stylus's PointerIcon,
reset the PointerIcon when handwriting is successfully initiated.
2. Inject the handwriting events directly into the InkWindow's view root
instead of dispatching it using the view's dispatchTouchEvent()
method so that things that are handled by the InkView's root will
work as expected, such as setting the pointer icon. This will allow
the InkView to change the PointerIcon using onResolvePointerIcon.
Bug: 275851541
Test: Manual
Change-Id: I97d8d4293a5440a6d6531f279ed7811370671111
Fixes an issue with TextBoundsInfoResultReceiver, where any Executor
that does not run the Runnable directly crashes, because the mConsumer
is cleared before it is run. Also avoids calling into the executor
with internal locks held.
Bug: 265457058
Test: atest InputConnectionEndToEndTest
Change-Id: I4b229494fb2451135ae1075272f04d865a9b509e
Fixes an issue where mConsumer was cleared too early for any executor
other than Runnable::run, leading to an NPE when the Runnable is invoked
on the Executor.
Fixes: 265457058
Test: atest InputConnectionEndToEndTest
Change-Id: Ifc8e435e02520eb29c9631427daa5a1a1ea0ccf0
To parse InputMethod_configChanges locally without waiting system
callback with initializeInternal, in case IME#mInputView may not
able to call resetStateForNewConfiguration in time before
IME#initializeInternal when it's required.
Fix: 260198823
Test: atest InputMethodServiceTest
Change-Id: I0268360f1b60ebc1f2676d3edab1910a9ce0f050
Add logic in IMS#onShowInputRequested: if IMS receives a Implicit show request and the keyboard is already shown in full screen mode, there is no need to hide it.
Otherwise it would hide the keyboard after rotating to landscape mode, because the rotation causes recreation of the activity and triggers auto-show behavior of Ime.
Bug: 256739702
Test: manually test
Change-Id: I195c2c6bd6f6815806dc90f0a386b7c0bccee7a1
Test: filter logcat for ImeTracker tag, open some apps with IME connection (e.g. Dialer, Messaging, etc.) and close the soft keyboard, check that tracking reflects observed behaviour
Change-Id: Icf9ab3fc0f7a7116456c13328d22f8b8428a0c79
Test: filter logcat for ImeTracker tag, open some apps with IME connection (e.g. Dialer, Messaging, etc.), check that tracking reflects observed behaviour
Change-Id: I73dec2e9e2d5f919c7a006828ee0b12a998fc7d9
Introduce new API to support gesture preview as user is operating over
text.
Bug: 254726230
Bug: 254727073
Test: InputConnectionEndToEndTest
Change-Id: I6c2ac5a5aaeaeab78411d24870f573670304e898
Add more description to discourage IME developers
not use deprecated onCreateInputMethodInterface and
onCreateInputMethodSessionInterface.
Also move paragraph tag since Block tags should be
put after the main documentation.
Bug: 254278652
Test: presubmit
Change-Id: I729fbe2e1544fc72580a08ccb763ab69c58af92d
This is a follow up CL to our previous CL [1], which introduced
HandwritingGesture and several subclasses.
One of the challenge is that we only wanted to make child classes
Parcelable, while keeping the abstract base class HandwritingGesture
non-Parcelable. Although InputConnection has only one method
InputConnection#performHandwritingGesture(
HandwritingGesture, ResultReceiver),
in the IPC layer IRemoteInputConnection needed to define methods for
each subclass, e.g.
* performHandwritingSelectGesture(in InputConnectionCommandHeader,
in SelectGesture, ...)
* performHandwritingInsertGesture(in InputConnectionCommandHeader,
in InsertGesture, ...)
* performHandwritingDeleteGesture(in InputConnectionCommandHeader,
in DeleteGesture, ...)
because their abstract class HandwritingGesture is not Parcelable.
To avoid such method definitions (and lots of type-based dispatching /
merging logic), this CL introduces
ParcelableHandwritingGesture
as a generic Parcelable container of HandwritingGesture subclasses.
You can freely use ParcelableHandwritingGesture in AIDL method
definitions as follows.
performHandwritingGesture(in InputConnectionCommandHeader,
in ParcelableHandwritingGesture, ...)
In the Java side, you can easily wrap objects as follows.
var parcelableGesture = ParcelableHandwritingGesture.of(gesture);
var unparceledGesture = parcelableGesture.get();
Note that this CL is still an internal cleanup. There must be no
developer observable behavior change.
[1]: I53bcb62e03ac1c371feb60d1385c88c921754092
3e3ff1a3d2
Bug: 234882948
Bug: 239783077
Test: presubmit
Test: atest FrameworksCoreTests:ParcelableHandwritingGestureTest
Change-Id: I158026087653f6772a78cc2394e678ae9741fb00
This is an API for IME to request text bounds information from editor to
perform handwriting rich gestures. It's useful for IMEs to create custom
handwriting gesture that's not supported the HandwritingGesture. And
it can also be used to provide default rich gesture implementation for
handwriting gesture compatibility.
Bug: 239843501
Test: atest TextBoundsInfoTest
Change-Id: Ia7522371976a4e1fcdff4cc0d244ea427ad3d7c9
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