Ensure View#onInputConnectionClosedInternal() timing
This is a follow up CL to our previous CLs [1][2], which introduced
an @hide callback
View#onInputConnectionClosedInternal()
to notify View when an is closed.
What this CL aims to do is to fix a potential problem in a code path
that has not been yet used. Thus there should be, in theory, no
observable app compat impact.
The problem is that
RemoteInputConnectionImpl#deactivate()
can dispatch
A: View#onInputConnectionClosedInternal()
before
B: InputConnection#closeConnection()
is completed when A and B need to be dispatched to two different
threads. This can, in theory, happen when
A: View#onInputConnectionClosedInternal()
C: InputConnection#getHandler()
are both explicitly overridden. That said, A is still @hide and only
by TextView, which basically does not support InputConnection with a
custom InputConnection#getHandler().
Anyway, with this CL A is guaranteed to happen after B under any
circumstances.
[1]: Iaafb0a03126c9292c24415f866dbdd72cadfa239
7b384751ea2a19beb7a635c52545742b2171ae8d
[2]: I9280604e7ec7e8d08c1179e6bbf0068647a41040
7b384751ea2a19beb7a635c52545742b2171ae8d
Bug: 163400105
Test: atest FrameworksCoreTests:ViewInputConnectionTest
Change-Id: I8a0e321ecf6e0b3be4b6ab1a35e6ac7259826c2e
2 files changed