File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
BaseAdbInput/src/main/java/com/bihe0832/android/base/adb/input Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1919public class ZixieIME extends InputMethodService {
2020
2121 public String IME_ADB_INPUT_ACTION = "ZIXIE_ADB_INPUT" ;
22- public static final String IME_NAME = "com.bihe0832.adb.input/com.bihe0832.android.base.adb.input.ZixieIME" ;
23-
22+
2423 public static final String TAG = "InputService" ;
2524 private InputServiceActionListener mInputServiceActionListener = null ;
2625
Original file line number Diff line number Diff line change @@ -30,16 +30,20 @@ object InputSwitchTools {
3030 fun hasInstall (context : Context ? ): Boolean {
3131 (context?.getSystemService(Context .INPUT_METHOD_SERVICE ) as InputMethodManager )?.let {
3232 it.enabledInputMethodList.forEach { inputMethodInfo ->
33- if (inputMethodInfo.id.equals(ZixieIME . IME_NAME )) {
33+ if (inputMethodInfo.id.equals(getIMEName(context) )) {
3434 return true
3535 }
3636 }
3737 }
3838 return false
3939 }
4040
41+ private fun getIMEName (context : Context ? ): String {
42+ return context?.packageName + " /" + ZixieIME ::class .java.name
43+ }
44+
4145 fun isSelected (context : Context ? ): Boolean {
42- return Settings .Secure .getString(context?.getContentResolver(), Settings .Secure .DEFAULT_INPUT_METHOD ).equals(ZixieIME . IME_NAME )
46+ return Settings .Secure .getString(context?.getContentResolver(), Settings .Secure .DEFAULT_INPUT_METHOD ).equals(getIMEName(context) )
4347
4448 }
4549
You can’t perform that action at this time.
0 commit comments