Fix ActivityViewTest#testInputMethod failed in freeform mode
Since IMM#reportActivityView() expects a matrix that transform coordinates
that maps (0, 0) in the ActivityView to the actual screen coordinates in
the host process.
So transform coordinates with getLocationInWindow which presents the location
that inside of ActivityView will be wrong when in freeform mode.
We should use getLocationOnScreen to fix this.
Fix: 137566626
Test: atest ActivityViewTest#testInputMethod in freeform / desktop mode
Test: manual as below steps:
0) Make sure device connected HW keyboard & set Gboard launguages
as Japanese input.
1) Make and install ActivityViewTest.
2) Launch any app and enter split screen mode.
3) Launch "AV Main" with shortcut in split screen bottom stack.
4) Press "Test Scroll ActiviyView" - > "launch"
5) Scroll down ActivityView & tap EditText and then type words with
HW keyboard.
6) Check if candidate view shown on the right place that aligned
with EditText.
Change-Id: Ia40b9aa94028592fd16e45c7226ec6e3cf07c9b1
1 file changed