Skip updateCursorAnchorInfo when matrix is null

Sometimes, the activityViewToScreenMatrix is null, we should skip
updateing cusor anchor info in such cases.
Fix: 139135335
Test: Manually using the steps in bug.

Change-Id: Ie58ad9a311a8f630b0a6d27d60ca017abc95ef45
This commit is contained in:
Tarandeep Singh
2019-08-21 17:55:51 -07:00
committed by Taran Singh
parent e6e214e227
commit 561a199ac7

View File

@@ -707,9 +707,10 @@ public final class InputMethodManager {
if (mBindSequence != bindSequence) {
return;
}
if (matrixValues == null) {
// That this app is unbound from the parent ActivityView. In this case,
// calling updateCursorAnchorInfo() isn't safe. Only clear the matrix.
if (matrixValues == null || mActivityViewToScreenMatrix == null) {
// Either InputBoundResult#mActivityViewToScreenMatrixValues is null
// OR this app is unbound from the parent ActivityView. In this case,
// calling updateCursorAnchorInfo() isn't safe. Only clear the matrix.
mActivityViewToScreenMatrix = null;
return;
}