Android SDK deletes the built-in TouchPal input method

question

Android 8.1.0,
Zhanrui platform.
After CTA certification, the built-in TouchPal input method will connect to the network, and by default, it will obtain the permission to access the network. If there is no pop-up request window to access the user, it will result in failure to pass the certification.

  1. The preset application TouchPal Input Method Go version is not explicitly connected to the Internet (after it is turned on), and the traffic consumption of the TouchPal Input Method Go version is not clearly indicated

Corresponding method: disable TouchPal input method. Switch to native google input method
Package name and class name of common input methods
Baidu: com.baidu.input/.ImeService
Xunfei: com.iflytek.inputmethod/.FlyIME
Tencent: com.tencent.qqpinyin/.QQPYInputMethodService
Google: com.google .android.inputmethod.pinyin/.PinyinIME
Sogou: com.sohu.inputmethod.sogou/.SogouIME
TouchPal: com.cootek.smartinput5/.

Set the default input method to native input method LatinIME

Android 8.1 uses the platform SDK from TouchPal input method. After the device is started, you will see the following directory system/vital-app/TouchPalGlobal/. I
​​want to delete it and replace it with Google's.
SDK TouchPal directory ./vendor/sprd/partner/TouchPal
searched to enable TouchPal compilation configuration item:
sprd/feature_configs/oversea/config.mk:18: TouchPalGlobal

delete its configuration

diff --git a/sprd/feature_configs/oversea/config.mk b/sprd/feature_configs/oversea/config.mk
index bc86c4a3b..4e48c4914 100644
--- a/sprd/feature_configs/oversea/config.mk
+++ b/sprd/feature_configs/oversea/config.mk
@@ -15,7 +15,6 @@
 # Now, let's get it on as follows
 
 FEATURES.PRODUCT_PACKAGES += \
-    TouchPalGlobal \
     WakeupScreenPlugin
 
 FEATURES.PRODUCT_PROPERTY_OVERRIDES += \

find ./ -name TouchPal*
Find TouchPal related under SDK

Delete TouchPal
rm vendor/sprd/partner/TouchPal/ -r

There are also some compiled apk and other files in the out directory, which are also deleted.

It can also be set to the Google Chinese input method
frameworks directory

diff --git a/base/packages/SettingsProvider/res/values/defaults.xml b/base/packages/SettingsProvider/res/values/defaults.xml
index 4deb9875..a9c63f48 100644
--- a/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/base/packages/SettingsProvider/res/values/defaults.xml
@@ -205,4 +205,9 @@
 
     <!-- SPRD: bug751026 Set launcher3 as enable for Settings.Secure.ENABLED_NOTIFICATION_LISTENERS -->
     <string name="def_enabled_notification_listeners" translatable="false">com.android.launcher3/com.android.launcher3.notification.NotificationListener</string>
+
+     <!-- Add by -->
+    <string name="config_default_input_method" translatable="false">com.google.android.inputmethod.pinyin/.PinyinIME</string>
+    <string name="config_enabled_input_method" translatable="false">com.google.android.inputmethod.pinyin/.PinyinIME</string>
+
 </resources>
diff --git a/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 6e8bbc6b..3453ee81 100644
--- a/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -2509,7 +2509,11 @@ class DatabaseHelper extends SQLiteOpenHelper {
             loadStringSetting(stmt, Settings.Secure.ENABLED_NOTIFICATION_LISTENERS,
                     R.string.def_enabled_notification_listeners);
             /* @} */
-
+            
+            loadStringSetting(stmt, Settings.Secure.DEFAULT_INPUT_METHOD,
+                        R.string.config_default_input_method);
+            loadStringSetting(stmt, Settings.Secure.ENABLED_INPUT_METHODS,
+                        R.string.config_enabled_input_method);
             /*
              * IMPORTANT: Do not add any more upgrade steps here as the global,
              * secure, and system settings are no longer stored in a database
diff --git a/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 2b11da3b..76058c3e 100644
--- a/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -2899,7 +2899,7 @@ public class SettingsProvider extends ContentProvider {
         }
 
         private final class UpgradeController {
-            private static final int SETTINGS_VERSION = 148;
+            private static final int SETTINGS_VERSION = 150;
 
             private final int mUserId;
 
@@ -3458,6 +3458,34 @@ public class SettingsProvider extends ContentProvider {
                     }
                     currentVersion = 148;
                 }
+                if (currentVersion == 148) {
+                    // Version 148: Set the default value for DEFAULT_INPUT_METHOD.
+                    final SettingsState secureSettings = getSecureSettingsLocked(userId);
+                    final Setting currentSetting = secureSettings
+                            .getSettingLocked(Settings.Secure.DEFAULT_INPUT_METHOD);
+                    if (currentSetting.isNull()) {
+                            final String defaultValue = getContext().getResources().getString(R.string.config_default_input_method);
+                            if (defaultValue != null) {
+                                    secureSettings.insertSettingLocked(Settings.Secure.DEFAULT_INPUT_METHOD,
+                                    defaultValue, null, true, SettingsState.SYSTEM_PACKAGE_NAME);
+                            }
+                    }
+                    currentVersion = 149;
+                }
+                if (currentVersion == 149) {
+                    // Version 149: Set the default value for ENABLED_INPUT_METHODS.
+                    final SettingsState secureSettings = getSecureSettingsLocked(userId);
+                    final Setting currentSetting = secureSettings
+                            .getSettingLocked(Settings.Secure.ENABLED_INPUT_METHODS);
+                    if (currentSetting.isNull()) {
+                            final String defaultValue = getContext().getResources().getString(R.string.config_enabled_input_method);
+                            if (defaultValue != null) {
+                                    secureSettings.insertSettingLocked(Settings.Secure.ENABLED_INPUT_METHODS,
+                                    defaultValue, null, true, SettingsState.SYSTEM_PACKAGE_NAME);
+                            }
+                    }
+                    currentVersion = 150;
+                }
 
                 // vXXX: Add new settings above this point.


Author: Too handsome to go out and refuse to reprint

Guess you like

Origin blog.csdn.net/zmlovelx/article/details/129219528