完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
1:输入法,我用芯瑞微方案,已经用过的方法提供了方法的目录里预装
2:框架/base/packages/SettingsProvider/res/values/defaults.xml diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml old mode 100644 new mode 100755 index 1b7e3ac..fd5f630 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -188,6 +188,9 @@ + + + 3: frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java old mode 100644 new mode 100755 index d8f3daf..e616be2 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -2460,6 +2460,11 @@ class DatabaseHelper extends SQLiteOpenHelper { loadIntegerSetting(stmt, Settings.Secure.SLEEP_TIMEOUT, R.integer.def_sleep_timeout); + loadStringSetting(stmt, Settings.Secure.DEFAULT_INPUT_METHOD, + R.string.def_input_method ); + + loadStringSetting(stmt, Settings.Secure.ENABLED_INPUT_METHODS, + R.string.def_enabled_input_methods); /* * IMPORTANT: Do not add any more upgrade steps here as the global, * secure, and system settings are no longer stored in a database 4:frameworks/base/services/core/java/com/android/server/InputMethodManagerService.java diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java old mode 100644 new mode 100755 index c23757f..38c4c54 --- a/services/core/java/com/android/server/InputMethodManagerService.java +++ b/services/core/java/com/android/server/InputMethodManagerService.java @@ -3522,7 +3522,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } // TODO: The following code should find better place to live. - if (!resetDefaultEnabledIme) { +/* if (!resetDefaultEnabledIme) { boolean enabledImeFound = false; final List final int N = enabledImes.size(); @@ -3541,7 +3541,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub resetSelectedInputMethodAndSubtypeLocked(""); } } - +*/ if (resetDefaultEnabledIme) { final ArrayList InputMethodUtils.getDefaultEnabledImes(mContext, mMethodList); 方法二 1:同样的方法一要先安装成功的输入法 2:frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index cebf0a7..015cc10 100755 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -253,6 +253,7 @@ import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.util.List; +import java.util.Locale; /** * WindowManagerPolicy implementation for the Android phone UI. This @@ -2107,6 +2108,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { filter.addAction(Intent.ACTION_SHUTDOWN); context.registerReceiver(mShutdownanimationReceiver, filter); + filter = new IntentFilter(); + filter.addAction(Intent.ACTION_BOOT_COMPLETED); + filter.addAction(Intent.ACTION_LOCALE_CHANGED); + context.registerReceiver(mChangeInputMethodReceiver, filter); + // monitor for system gestures mSystemGestures = new SystemGesturesPointerEventListener(context, new SystemGesturesPointerEventListener.Callbacks() { @@ -6752,7 +6758,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { } }; - BroadcastReceiver mShutdownanimationReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -6764,6 +6769,29 @@ public class PhoneWindowManager implements WindowManagerPolicy { } }; + // 配置默认输入法 + BroadcastReceiver mChangeInputMethodReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (Intent.ACTION_LOCALE_CHANGED.equals(intent.getAction()) + || Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { + + Locale locale = context.getResources().getConfiguration().locale; + String language = locale.getLanguage(); + if (language.endsWith("zh")) { + Settings.Secure.putString(context.getContentResolver(), + Settings.Secure.DEFAULT_INPUT_METHOD, + "com.iflytek.inputmethod/.FlyIME"); + } + else { + Settings.Secure.putString(context.getContentResolver(), + Settings.Secure.DEFAULT_INPUT_METHOD, + "com.android.inputmethod.latin/.LatinIME"); + } + } + } + }; + private final Runnable mHiddenNavPanic = new Runnable() { @Override public void run() { |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于米尔瑞芯微RK3576核心板/开发板的人脸疲劳检测应用方案
937 浏览 0 评论
1138 浏览 1 评论
935 浏览 1 评论
2163 浏览 1 评论
3475 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-28 01:59 , Processed in 0.534723 second(s), Total 70, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号