From cb0cc4e65a9e99e4b670cb852f47f25d0fc4834d Mon Sep 17 00:00:00 2001 From: Helium314 Date: Tue, 23 Jan 2024 12:43:18 +0100 Subject: [PATCH] remove unused code --- .../latin/utils/InputTypeUtils.java | 31 +++---------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/InputTypeUtils.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/InputTypeUtils.java index 03d95c306..4ceb7b292 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/InputTypeUtils.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/InputTypeUtils.java @@ -12,8 +12,6 @@ import android.view.inputmethod.EditorInfo; public final class InputTypeUtils implements InputType { private static final int WEB_TEXT_PASSWORD_INPUT_TYPE = TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_WEB_PASSWORD; - private static final int WEB_TEXT_EMAIL_ADDRESS_INPUT_TYPE = - TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS; private static final int NUMBER_PASSWORD_INPUT_TYPE = TYPE_CLASS_NUMBER | TYPE_NUMBER_VARIATION_PASSWORD; private static final int TEXT_PASSWORD_INPUT_TYPE = @@ -32,23 +30,12 @@ public final class InputTypeUtils implements InputType { // This utility class is not publicly instantiable. } - private static boolean isWebEditTextInputType(final int inputType) { - return inputType == (TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_WEB_EDIT_TEXT); - } - private static boolean isWebPasswordInputType(final int inputType) { - return WEB_TEXT_PASSWORD_INPUT_TYPE != 0 - && inputType == WEB_TEXT_PASSWORD_INPUT_TYPE; - } - - private static boolean isWebEmailAddressInputType(final int inputType) { - return WEB_TEXT_EMAIL_ADDRESS_INPUT_TYPE != 0 - && inputType == WEB_TEXT_EMAIL_ADDRESS_INPUT_TYPE; + return inputType == WEB_TEXT_PASSWORD_INPUT_TYPE; } private static boolean isNumberPasswordInputType(final int inputType) { - return NUMBER_PASSWORD_INPUT_TYPE != 0 - && inputType == NUMBER_PASSWORD_INPUT_TYPE; + return inputType == NUMBER_PASSWORD_INPUT_TYPE; } private static boolean isTextPasswordInputType(final int inputType) { @@ -65,29 +52,21 @@ public final class InputTypeUtils implements InputType { } public static boolean isUriOrEmailType(final int inputType) { + if ((inputType & TYPE_MASK_CLASS) != TYPE_CLASS_TEXT) return false; final int maskedInputType = inputType & TYPE_MASK_VARIATION; return maskedInputType == TYPE_TEXT_VARIATION_URI || isEmailVariation(maskedInputType); } - public static boolean isWebInputType(final int inputType) { - final int maskedInputType = - inputType & (TYPE_MASK_CLASS | TYPE_MASK_VARIATION); - return isWebEditTextInputType(maskedInputType) || isWebPasswordInputType(maskedInputType) - || isWebEmailAddressInputType(maskedInputType); - } - // Please refer to TextView.isPasswordInputType public static boolean isPasswordInputType(final int inputType) { - final int maskedInputType = - inputType & (TYPE_MASK_CLASS | TYPE_MASK_VARIATION); + final int maskedInputType = inputType & (TYPE_MASK_CLASS | TYPE_MASK_VARIATION); return isTextPasswordInputType(maskedInputType) || isWebPasswordInputType(maskedInputType) || isNumberPasswordInputType(maskedInputType); } // Please refer to TextView.isVisiblePasswordInputType public static boolean isVisiblePasswordInputType(final int inputType) { - final int maskedInputType = - inputType & (TYPE_MASK_CLASS | TYPE_MASK_VARIATION); + final int maskedInputType = inputType & (TYPE_MASK_CLASS | TYPE_MASK_VARIATION); return maskedInputType == TEXT_VISIBLE_PASSWORD_INPUT_TYPE; }