fix(android/engine): Clear WebView cache on package install

This commit is contained in:
Darcy Wong 2022-02-25 11:18:07 +07:00
parent 83c8b87f42
commit fcc75ec00e
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;