spiegel-keyman/android/KMAPro/kMAPro
Marc Durdin 958fbd3e40 fix(android): check index validity in getCurrentKeyboardInfo
This fixes crash reported as #6703. This issue was first reported in
14.0.282-stable. I have done a careful review of changes in 14.0.282
(and 14.0.281) but have been unable to find any changes that could have
bearing on this.

The basic issue is that there appears to be some circumstances where
`KMManager` thinks that it has a keyboard loaded (ref
`SystemKeyboardLoaded` variable), but `KMKeyboard.currentKeyboard` is
still `null`.

The crash has been reported for only a very small set of users, 119 at
time of fix, but average reports per user is over 100. As is usual with
this type of thing, a small fraction of those users are reporting the
majority of crashes. I have not found any real commonality across the
error reports -- they are geographically dispersed, across multiple
device types and Android versions.

Note that this addresses the error at hand but as I am unable to
reproduce the issue, does not necessarily address the root problem, so
there may still be other issues reported even after this is fixed.

A longer-term refactor would eliminate `SystemKeyboardLoaded` because
from what I can tell, we should always be able to determine that from
the state of `KMKeyboard.currentKeyboard`. However, the state
entanglement is a lot deeper than just those two variables, with cross
references to keyboard indexes between `KMManager` and `KMKeyboard`
which need to be resolved (`KMKeyboard` should *never* refer to
`KMManager`).
2022-06-05 06:46:39 +10:00
..
libs Keyman for Android 2.8 Open Source 2017-07-21 11:52:22 +07:00
src/main fix(android): check index validity in getCurrentKeyboardInfo 2022-06-05 06:46:39 +10:00
build.gradle chore(android): Update Play publishing plugin to 3.5.0 2022-02-08 08:49:37 +07:00
lint.xml feat(android): Start adding Sentry SDK 2020-02-28 16:24:48 +07:00