Merge "Fix potential failures in InputMethodService (2nd try)"