Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e9490612 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

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
      3e3ff1a3

Bug: 234882948
Bug: 239783077
Test: presubmit
Test: atest FrameworksCoreTests:ParcelableHandwritingGestureTest
Change-Id: I158026087653f6772a78cc2394e678ae9741fb00
parent a99bb97e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment