Fix web input type judgment

Bug: 4490948
Change-Id: I71efb8f5784970f1d2a94da1d2eb852f7f11885f
This commit is contained in:
Tadashi G. Takaoka 2011-05-28 23:47:21 +09:00
parent 88251a9555
commit c25e07d212
2 changed files with 8 additions and 4 deletions

View file

@ -60,6 +60,11 @@ public class InputTypeCompatUtils {
: 0; : 0;
} }
private static boolean isWebEditTextInputType(int inputType) {
return inputType == (InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT);
}
private static boolean isWebPasswordInputType(int inputType) { private static boolean isWebPasswordInputType(int inputType) {
return WEB_TEXT_PASSWORD_INPUT_TYPE != 0 return WEB_TEXT_PASSWORD_INPUT_TYPE != 0
&& inputType == WEB_TEXT_PASSWORD_INPUT_TYPE; && inputType == WEB_TEXT_PASSWORD_INPUT_TYPE;
@ -92,8 +97,7 @@ public class InputTypeCompatUtils {
public static boolean isWebInputType(int inputType) { public static boolean isWebInputType(int inputType) {
final int maskedInputType = final int maskedInputType =
inputType & (InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION); inputType & (InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION);
return maskedInputType == InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT return isWebEditTextInputType(maskedInputType) || isWebPasswordInputType(maskedInputType)
|| isWebPasswordInputType(maskedInputType)
|| isWebEmailAddressInputType(maskedInputType); || isWebEmailAddressInputType(maskedInputType);
} }

View file

@ -39,8 +39,8 @@ import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceChangeListener { public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceChangeListener {
private static final String TAG = "KeyboardSwitcher"; private static final String TAG = KeyboardSwitcher.class.getSimpleName();
private static final boolean DEBUG_CACHE = false; private static final boolean DEBUG_CACHE = LatinImeLogger.sDBG;
public static final boolean DEBUG_STATE = false; public static final boolean DEBUG_STATE = false;
private static String sConfigDefaultKeyboardThemeId; private static String sConfigDefaultKeyboardThemeId;