question: private void addSystemImes ( Set < String > excludePackages ) { final Context context = getActivity ( ) ; if ( context == null ) return ; InputMethodManager imm = ( InputMethodManager ) context . getSystemService ( Context . INPUT_METHOD_SERVICE ) ; List < InputMethodInfo > imis = imm . getInputMethodList ( ) ; for ( InputMethodInfo imi : imis ) { try { if ( imi . isDefault ( context ) && isSystemPackage ( imi . getPackageName ( ) ) ) { excludePackages . add ( imi . getPackageName ( ) ) ; } } catch ( Resources . NotFoundException rnfe ) { } } }
target:  Find all pre-installed input methods that are marked as default and add them to an exclusion list so that they aren't presented to the user for toggling. Don't add non-default ones, as they may include other stuff that we don't need to auto-include.