From d6884ef8943093edbab14fdc52beb881009dc99f Mon Sep 17 00:00:00 2001 From: Dimo Karaivanov Date: Mon, 20 Mar 2023 11:30:01 +0200 Subject: [PATCH] fixed dialer field detection --- src/io/github/sspanak/tt9/ime/helpers/InputType.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/io/github/sspanak/tt9/ime/helpers/InputType.java b/src/io/github/sspanak/tt9/ime/helpers/InputType.java index b73bb324..d9334d9d 100644 --- a/src/io/github/sspanak/tt9/ime/helpers/InputType.java +++ b/src/io/github/sspanak/tt9/ime/helpers/InputType.java @@ -40,10 +40,14 @@ public class InputType { * NOTE: A Dialer field is not the same as a Phone field in a phone book. */ public boolean isDialer() { + if (field == null) { + return false; + } + + int inputType = field.inputType & android.text.InputType.TYPE_MASK_CLASS; + return - field != null - && field.inputType == android.text.InputType.TYPE_CLASS_PHONE - && field.packageName.equals("com.android.dialer"); + inputType == android.text.InputType.TYPE_CLASS_PHONE && field.packageName.equals("com.android.dialer"); }