Do not merge. Backport two fixes for InputMethethodFramework

Bug: 3420384

backport cl1: Iaf293cf6c6fb35a994f344b0afc30e9f523032f4
backport cl2: I29d2555aeb7d0e51205d9f1fe0da708df0890942

Change-Id: Ia71ba27957fa818dc4ef8ff05b5fdb120b9650e0
2 files changed