ANDROID: Fix warning unchecked conversion

In CustomKeyboardView for mKeysDownCodesSet ArraySet

Also enable the option -Xlint:unchecked (within build.gradle) to show the unchecked conversion warnings on compile
This commit is contained in:
antoniou 2021-08-05 13:26:31 +03:00
parent 1b5f986df9
commit dad5179e9d
2 changed files with 3 additions and 3 deletions

View File

@ -203,7 +203,7 @@ public class CustomKeyboardView extends View implements View.OnClickListener {
private int mCurrentKey = NOT_A_KEY;
private int mDownKey = NOT_A_KEY;
// New auxilliary set to keep track of any keys that were not released at the time of closing the keyboard
// New auxiliary set to keep track of any keys that were not released at the time of closing the keyboard
private ArraySet<Integer> mKeysDownCodesSet;
private long mLastKeyTime;
@ -439,7 +439,7 @@ public class CustomKeyboardView extends View implements View.OnClickListener {
mAccessibilityManager = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
mKeysDownCodesSet = new ArraySet();
mKeysDownCodesSet = new ArraySet<>();
resetMultiTap();
}

View File

@ -17,7 +17,7 @@ dependencies {
// Enable to see use of deprecated API
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}
apply plugin: 'com.android.application'