upgrade build.gradle and do some code inspection stuff

This commit is contained in:
Helium314 2024-05-15 22:47:24 +02:00
parent f825436449
commit 528bbb4f7f
33 changed files with 192 additions and 256 deletions

View file

@ -6,6 +6,7 @@
package helium314.keyboard.latin;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@ -783,6 +784,7 @@ public class LatinIME extends InputMethodService implements
* Starts from {@link android.os.Build.VERSION_CODES#S_V2}, the returning context object has
* became to IME context self since it ends up capable of updating its resources internally.
*/
@SuppressWarnings("deprecation")
private @NonNull Context getDisplayContext() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S_V2) {
// IME context sources is now managed by WindowProviderService from Android 12L.
@ -1104,10 +1106,6 @@ public class LatinIME extends InputMethodService implements
}
}
public CharSequence getSelection() {
return mInputLogic.mConnection.getSelectedText(0);
}
/**
* This is called when the user has clicked on the extracted text view,
* when running in fullscreen mode. The default implementation hides
@ -1667,14 +1665,11 @@ public class LatinIME extends InputMethodService implements
*/
private void updateStateAfterInputTransaction(final InputTransaction inputTransaction) {
switch (inputTransaction.getRequiredShiftUpdate()) {
case InputTransaction.SHIFT_UPDATE_LATER:
mHandler.postUpdateShiftState();
break;
case InputTransaction.SHIFT_UPDATE_NOW:
mKeyboardSwitcher.requestUpdatingShiftState(getCurrentAutoCapsState(),
getCurrentRecapitalizeState());
break;
default: // SHIFT_NO_UPDATE
case InputTransaction.SHIFT_UPDATE_LATER -> mHandler.postUpdateShiftState();
case InputTransaction.SHIFT_UPDATE_NOW -> mKeyboardSwitcher
.requestUpdatingShiftState(getCurrentAutoCapsState(), getCurrentRecapitalizeState());
default -> {
} // SHIFT_NO_UPDATE
}
if (inputTransaction.requiresUpdateSuggestions()) {
final int inputStyle;
@ -1897,6 +1892,7 @@ public class LatinIME extends InputMethodService implements
}
}
@SuppressLint("SwitchIntDef")
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);