Ok, so I have been able to use GLOBE_KEY_ACTION_ADVANCE_TO_NEXT_SYSTEM_KEYBOARD the 14 beta in my copy of the sample (kmsample2-14) https://github.com/MattGyverLee/keyman-engine-android-testing. It even works with minify turned on in Gradle. So, this isn’t a Keyman Bug anymore.
Unfortunately, everything works on my CameroonKeyboard app, except I cannot get GLOBE_KEY_ACTION_ADVANCE_TO_NEXT_SYSTEM_KEYBOARD to work in my real project.
I can enable and activate the keyboard in Android settings. I can use the keyboard in any app. I can use the android IME switcher to enable my keybaord. All of the other globe-key options work, even the new GLOBE_KEY_ACTION_SHOW_SYSTEM_KEYBOARDS,
and I can’t find any functional differences between keyman2-14 and my app. I’m using the same version of KMEngine, the same verison of android (29), the same phone, I’ve wiped the memory, it calls the same functions with the same parameters, the same keyboards, and everything except the project name on SystemKeyboard.java is the same.
If someone can help, I will gladly add them to my private repository. I was really hoping to release this version before the new year.
KMSample and CameroonKeyboard
If I set GLOBE_KEY_ACTION_ADVANCE_TO_NEXT_SYSTEM_KEYBOARD and add several other keyboards to the emulator. the Globe on the KM keyboard calls this code in KMManager.java:
case GLOBE_KEY_ACTION_ADVANCE_TO_NEXT_SYSTEM_KEYBOARD:
KMManager.advanceToNextInputMode();
break;
and then this code:
public static void advanceToNextInputMode() {
if (VERSION.SDK_INT >= 28) {
if (IMService != null) {
IMService.switchToNextInputMethod(false);
}
then goes to inputMethodservice.java
public final boolean switchToNextInputMethod(boolean onlyCurrentIme) {
return mPrivOps.switchToNextInputMethod(onlyCurrentIme);
}
then it loops through this in parcel.java:
@NonNull
public static Parcel obtain() {
final Parcel[] pool = sOwnedPool;
synchronized (pool) {
Parcel p;
for (int i=0; i<POOL_SIZE; i++) {
p = pool[i];
if (p != null) {
pool[i] = null;
if (DEBUG_RECYCLE) {
p.mStack = new RuntimeException();
}
p.mReadWriteHelper = ReadWriteHelper.DEFAULT;
return p;
}
}
}
return new Parcel(0);
KMSample2-14
KMSample2-14 loops through Parcel several times, and one of the loops changes the IME. I can loop through the IMEs at will.
CameroonKeyboard
My project loops through Parcel and does not throw an error, but fails to change to the next IME, eventually returning to KMManager. It almost seems like KMManager in my app isn’t registered in the same group as Gboard and others.
The weird thing is that with CameroonKeyboard, Keyman’s globe does not work with GLOBE_KEY_ACTION_ADVANCE_TO_NEXT_SYSTEM_KEYBOARD, but the globes in my other IMEs (i.e. gboard) toggle through all other IMEs except my project. The only way to get back to my keyboard is to use .
Edit: My old version of the app with KME13 (https://github.com/MattGyverLee/CamKeyAndroid/tree/13GlobeTrial) and my trial KME14 (https://github.com/MattGyverLee/CamKeyAndroid/tree/KM14) version fail to switch to the Globe. I have added @darcy to the repository.
I can’t get my CameroonKeyboard app to switch IME’s with the globe, and I can’t figure out how to break the KMSample2-14 in the same way. I don’t know what to try, other than starting my app again from scratch to get this working!