From 6fb15b3f16a2d1976aae6828ba4d07087e74acf0 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 26 Nov 2022 15:46:45 +0100 Subject: [PATCH] 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. --- srcs/juloo.keyboard2/Keyboard2.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index 92ff0c1..165fbea 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -128,7 +128,10 @@ public class Keyboard2 extends InputMethodService private void refreshSubtypeImm() { 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) { // Subtypes won't work well under API level 12 (getExtraValueOf)