默认开启“显示输入法”开关


1.先在packages/SettingsProvider/res/values/defaults.xml中增加默认配置

diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index 863f702..6770186 100755
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -230,4 +230,6 @@
     <integer name="def_button_lights_off_timeout">1500</integer>
 <!--add by cg for 24 -->
     <string name="def_time_24">24</string>
+    <!--add by cg for Default for Settings.System.SHOW_IME_WITH_HARD_KEYBOARD-->
+    <integer name="def_show_ime_with_hard_keyboard">1</integer>
 </resources>

2.在/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java 中的loadSecureSettings(SQLiteDatabase db)方法中加入新字段的添加代码

chenguo@ubuntu:~/work/RK3229/hmd-rk3229/rk3229_5.1/frameworks/base$ git diff packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvi
index 3c835d6..ab85b04 100755
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -2521,6 +2521,10 @@ public class DatabaseHelper extends SQLiteOpenHelper {
 
             loadIntegerSetting(stmt, Settings.Secure.SLEEP_TIMEOUT,
                     R.integer.def_sleep_timeout);
+             //add by cg for Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD
+            loadIntegerSetting(stmt, Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD,
+                    R.integer.def_show_ime_with_hard_keyboard);

         } finally {
             if (stmt != null) stmt.close();
         }
(END)


Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐