diff options
| author | 2022-10-31 08:08:54 -0700 | |
|---|---|---|
| committer | 2022-10-31 08:08:54 -0700 | |
| commit | e9490612d5d436016f81195f2ef79c1e326b8960 (patch) | |
| tree | eabbedf23e44667c58b03d6a451e1c9a6ccf1b16 /libs/androidfw/StringPool.cpp | |
| parent | a99bb97e6736b29eeaf10903ce86fd2ee489a3a7 (diff) | |
Introduce @hide ParcelableHandwritingGesture
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
3e3ff1a3d298f74246597cb10529e52e96b0d7b9
Bug: 234882948
Bug: 239783077
Test: presubmit
Test: atest FrameworksCoreTests:ParcelableHandwritingGestureTest
Change-Id: I158026087653f6772a78cc2394e678ae9741fb00
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions