1. First adjust the input method on the device
Settings > Language IME >android keyboard (AOSP), in the input language, tick the language you want to choose, such as "English (United States)" and "Spanish" two kinds:
2. Select the default language for the system input method ("Spanish" in two languages by default)
Open an application that can bring up the input method, in the drop-down notification bar, "Select Input Method" is adjusted to "Spanish"
3. View Setting Database files
ADB pull data/data/com.android.providers.settings/databases/settings.db c \
Open the Secure table, view the contents of the Default_input_method,enabled_input_methods and Selected_input_method_subtype three fields, and record:
Default_input_method com.android.inputmethod.latin/. Latinime
Enabled_input_methods com.android.inputmethod.latin/. latinime;816242702;-921088104
Selected_input_method_subtype 816242702
4. Modify the Settingsprovider file
Frameworks/base/packages/settingsprovider/src/com/android/providers/settings/databasehelper.java
Add the following two lines in the function private void loadsecuresettings(sqlitedatabase db) (note that the Loadsecuresettings function, Not loadsystemsettings):
Loadsetting (stmt, Settings.Secure.ENABLED_INPUT_METHODS, defaultime); Loadsetting (stmt, Settings.Secure.DEFAULT_INPUT_METHOD, defaultime);
Modify to the following three lines:
Loadsetting (stmt, Settings.Secure.ENABLED_INPUT_METHODS, "com.android.inputmethod.latin/. latinime;816242702;-921088104 ");//Selected Input Method Loadsetting (stmt, Settings.Secure.DEFAULT_INPUT_METHOD," com.android.inputmethod.latin/. Latinime ");//The default input method is the system input Method loadsetting (stmt, Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE," 816242702 "); Default language for Default IME
Android Default Input Method check multi-language, and default one of the languages