Requirements:
Set the newly installed Input Method to available. You do not need to add it in settings.
Solution Process:
1. The input method is related. You must find the input method service, so find \ frameworks \ base \ Services \ Java \ com \ Android \ Server \ inputmethodmanagerservice. java.
2. ReadCodeIn the code, it is found that the packagemonitor class of the input method is installed and uninstalled, but only some methods are implemented, onsomepackageschanged, onhandleforcestop,
Therefore, you can add an input method to install the listener.
3. Override methods in frameworks \ base \ core \ Java \ com \ Android \ internal \ content \ packagemonitor. Java
Public void onpackageadded (string packagename, int UID ){
}
Public void onpackageremoved (string packagename, int UID ){
}
If a new input method is installed, you can listen to it in the onpackageadded method, and add the logic that makes the input method available here.
I have been doing this for a long time. I just wrote my thoughts. If something is wrong, please correct it.