设置默认输入法
在 frameworks/base/core/res/res/values/config.xml 添加一个属性:
<!--leo add-->
<string name="config_default_input_method">com.android.inputmethod.pinyin/.PinyinIME</string>
frameworks/base/services/java/com/android/server/InputMethodManagerService.java
的方法buildInputMethodListLocked() 里添加:
String defaultIme = Settings.Secure.getString(mContext
.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
//leo
if ( defaultIme == null )
{
final Resources res = mContext.getResources();
try
{
//frameworks/base/core/res/res/values/config.xml
String myIME = res.getString( com.android.internal.R.string.config_default_input_method );
if ( myIME != null && myIME.length() > 0 )
{
Settings.Secure.putString( mContext.getContentResolver(),
Settings.Secure.DEFAULT_INPUT_METHOD,
myIME );
}
}
catch ( Exception e )
{
}
}
http://hi.baidu.com/wishwingliao/blog/item/65a2d03f7dde8dd17d1e71ec.html
或者 frameworks/base/services/java/com/android/server/InputMethodManagerService.java
的方法buildInputMethodListLocked() 里添加:
static final String DEFAULT_IME_ID = "com.guobi.gbime/.GBIme";
String defaultIme = Settings.Secure.getString(mContext
.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
// set default ime as gbime
if (defaultIme == null) {
Settings.Secure.putString(mContext.getContentResolver(),
Settings.Secure.DEFAULT_INPUT_METHOD, DEFAULT_IME_ID);
}
defaultIme = Settings.Secure.getString(mContext
.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
国笔第三方软件,没有源码,路径在vendor/apkVendors/IME/GuoBi