Merge "Remove code duplication in InputMethodManagerService"