Stop using deprecated 'shouldOfferSwitchingToNextInputMethod'

This function has been introduced in API 19 and deprecated in API 28.
There was no version check for API 19 but instead of adding these,
simply remove the feature for API under 28.
This commit is contained in:
Jules Aguillon 2022-11-26 15:46:45 +01:00
parent 9a0e03f644
commit 6fb15b3f16

View File

@ -128,7 +128,10 @@ public class Keyboard2 extends InputMethodService
private void refreshSubtypeImm() private void refreshSubtypeImm()
{ {
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
_config.shouldOfferSwitchingToNextInputMethod = imm.shouldOfferSwitchingToNextInputMethod(getConnectionToken()); if (VERSION.SDK_INT < 28)
_config.shouldOfferSwitchingToNextInputMethod = true;
else
_config.shouldOfferSwitchingToNextInputMethod = shouldOfferSwitchingToNextInputMethod();
if (VERSION.SDK_INT < 12) if (VERSION.SDK_INT < 12)
{ {
// Subtypes won't work well under API level 12 (getExtraValueOf) // Subtypes won't work well under API level 12 (getExtraValueOf)