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

Let IC#requestCursorUpdates() fail for cross-display connections

Since Android Q [1], it is intentional that when an IME client app is
running on a (virtual) display where IME should not be hosted, IME
will be hosted in the default display instead.  This means that
cross-display App/IME interaction is an expected scenario now.

The problem is that CursorAnchorInfo API, which I introduced in
Android L [2], no longer works as intended in such a cross-display
scenario, because screen coordinates make sense only within the same
display.

The ultimate fallback strategy for this problem is forcing
  InputConnection#requestCursorUpdates()
to always return false for such a cross-display scenario, which is
exactly what this CL does.

In subsequent CLs, we aim to introduce a special handling logic for
ActivityView, where the system may be able to keep maintaining
sufficient display hierarchy information so that
CursorAnchorInfo#getMatrix() can be automatically adjusted before it
is passed to the IME.

 [1]: Iedd71e4ddf4983f90b02dd72e471e7fa8e838fbf
      ef1965bd
 [2]: I61dec2f8fa671ba891da1d4af08975750e3acb04
      1c7e66c97ce0a5d54e03abdee2f36fdce55944e6

Bug: 115693908
Fix: 131368625
Test: atest MultiDisplaySystemDecorationTests#testCrossDisplayBasicImeOperations
Change-Id: Ie2f7a5117cff3a13ad5c5806fd4b3abef7569549
parent 2f956b53
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