Merge "Update internal states stored in InputMethodManager properly"