fix nullref on exiting dialer by long pressing of Back key on KYF33 (#262)
* fix nullref on exiting com.android.dialer by long pressing of Back key on KYF33 * fix misleading ModeDialer.toString() * fix textField and inputType are assumed to be defined everywhere * fix yet another potential case of currentInputConnection = null --------- Co-authored-by: sspanak <doftor.livain@gmail.com>
This commit is contained in:
parent
b3fde40aa2
commit
7f6af7d413
3 changed files with 15 additions and 2 deletions
|
|
@ -82,6 +82,7 @@ abstract class KeyPadHandler extends InputMethodService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStartInputView(EditorInfo inputField, boolean restarting) {
|
public void onStartInputView(EditorInfo inputField, boolean restarting) {
|
||||||
|
currentInputConnection = getCurrentInputConnection();
|
||||||
onRestart(inputField);
|
onRestart(inputField);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import android.view.View;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -27,8 +29,10 @@ import io.github.sspanak.tt9.ui.tray.SuggestionsBar;
|
||||||
public class TraditionalT9 extends KeyPadHandler {
|
public class TraditionalT9 extends KeyPadHandler {
|
||||||
// internal settings/data
|
// internal settings/data
|
||||||
private boolean isActive = false;
|
private boolean isActive = false;
|
||||||
private TextField textField;
|
@NotNull
|
||||||
private InputType inputType;
|
private TextField textField = new TextField(null, null);
|
||||||
|
@NotNull
|
||||||
|
private InputType inputType = new InputType(null, null);
|
||||||
|
|
||||||
// editing mode
|
// editing mode
|
||||||
protected static final int NON_EDIT = 0;
|
protected static final int NON_EDIT = 0;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package io.github.sspanak.tt9.ime.modes;
|
package io.github.sspanak.tt9.ime.modes;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import io.github.sspanak.tt9.ime.helpers.Key;
|
import io.github.sspanak.tt9.ime.helpers.Key;
|
||||||
|
|
||||||
// see: InputType.isDialer()
|
// see: InputType.isDialer()
|
||||||
|
|
@ -12,4 +14,10 @@ public class ModeDialer extends Mode123 {
|
||||||
public boolean onOtherKey(int key) {
|
public boolean onOtherKey(int key) {
|
||||||
return !Key.isDecimalSeparator(key) && super.onOtherKey(key);
|
return !Key.isDecimalSeparator(key) && super.onOtherKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Dialer";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue