forked from https://android.googlesource.com/platform/packages/inputmethods/LatinIME