mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-24 16:46:35 +00:00
clear some caches on low memory
This commit is contained in:
parent
ca3790b519
commit
4d0b7915c8
1 changed files with 10 additions and 1 deletions
|
@ -50,6 +50,7 @@ import org.dslul.openboard.inputmethod.event.InputTransaction;
|
|||
import org.dslul.openboard.inputmethod.keyboard.Keyboard;
|
||||
import org.dslul.openboard.inputmethod.keyboard.KeyboardActionListener;
|
||||
import org.dslul.openboard.inputmethod.keyboard.KeyboardId;
|
||||
import org.dslul.openboard.inputmethod.keyboard.KeyboardLayoutSet;
|
||||
import org.dslul.openboard.inputmethod.keyboard.KeyboardSwitcher;
|
||||
import org.dslul.openboard.inputmethod.keyboard.MainKeyboardView;
|
||||
import org.dslul.openboard.inputmethod.latin.Suggest.OnGetSuggestedWordsCallback;
|
||||
|
@ -71,7 +72,6 @@ import org.dslul.openboard.inputmethod.latin.suggestions.SuggestionStripViewAcce
|
|||
import org.dslul.openboard.inputmethod.latin.touchinputconsumer.GestureConsumer;
|
||||
import org.dslul.openboard.inputmethod.latin.utils.ApplicationUtils;
|
||||
import org.dslul.openboard.inputmethod.latin.utils.ColorUtilKt;
|
||||
import org.dslul.openboard.inputmethod.latin.utils.DeviceProtectedUtils;
|
||||
import org.dslul.openboard.inputmethod.latin.utils.InputMethodPickerKt;
|
||||
import org.dslul.openboard.inputmethod.latin.utils.JniUtils;
|
||||
import org.dslul.openboard.inputmethod.latin.utils.LeakGuardHandlerWrapper;
|
||||
|
@ -2060,4 +2060,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrimMemory(int level) {
|
||||
super.onTrimMemory(level);
|
||||
switch (level) {
|
||||
case TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_COMPLETE ->
|
||||
KeyboardLayoutSet.onSystemLocaleChanged(); // clears caches, nothing else
|
||||
// deallocateMemory always called on hiding, and should not be called when showing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue