Merge "Remove duplicate code from InputMethodUtils"