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

Commit 1ab4cb2d authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Fix InputMethodServiceInternal lifetime

This is a follow up CL to my recent CL [1], which aimed to consolidate
dependencies on InputMethodService from RemoteInputConnection.

One thing I overlooked was that InputMethodService did not retain a
strong reference to InputMethodServiceInternal object that I
introduced there, which means that the newly instantiated
InputMethodServiceInternal could be garbage-collected even before
InputMethodService became unreachable.

As a result, the following InputConnection APIs could start failing at
some point and would never work without restarting the IME, which is
likely to be the root cause of the recent flakiness in
InputConnectionEndToEndTest discussed in Bug 193822485.

  * InputConnection#requestCursorUpdates()
  * InputConnection#commitContent()

Also, the following functionality might have stopped working at some
point.

  * InputMethodService#dump()
  * InputConnection tracing in IME tracing
  * Updating IME switching order based on user inputs

With this CL, the InputMethodServiceInternal instance is guaranteed to
be instantiated once and remain to be alive until
AbstractInputMethodService becomes unreachable.

 [1]: I2aeeeacd27195ce10059d6590e098a4a969e774d
      a975bfc4

Fix: 193822485
Fix: 199288389
Test: atest CtsInputMethodTestCases
Test: Manually verified with Imege Keyboard sample IME/app
Change-Id: I7ee0270bad94ed606048bfaf76e8545336715d83
parent dc0ffe41
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment