Merge pull request #6438 from keymanapp/fix/android/clear-cache-after-kmp

fix(android/engine): Clear WebView cache on package install
This commit is contained in:
Darcy Wong 2022-03-29 06:09:11 +07:00 committed by GitHub
commit cabbeabd09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -282,6 +282,8 @@ public class PackageActivity extends AppCompatActivity implements
notifyPackageInstallListeners(KeyboardEventHandler.EventType.PACKAGE_INSTALLED,
installedPackageKeyboards, 1);
}
KMManager.clearKeyboardCache();
if(_cleanup)
cleanup();
} else {

View file

@ -1579,6 +1579,17 @@ public final class KMManager {
registerAssociatedLexicalModel(kbInfo.getLanguageID());
}
public static void clearKeyboardCache() {
if (InAppKeyboard != null && InAppKeyboardLoaded) {
InAppKeyboard.clearCache(true);
InAppKeyboard.loadKeyboard();
}
if (SystemKeyboard != null && SystemKeyboardLoaded) {
SystemKeyboard.clearCache(true);
SystemKeyboard.loadKeyboard();
}
}
protected static IBinder getToken() {
if (IMService == null) {
return null;