From 3f65960e1614e01d882c15f153d9c5fc5fec5016 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 22 Feb 2012 16:16:32 -0800 Subject: [PATCH] Add debug prints to help with debugging This is intended to help tracking #6048808. Another bug has been filed to remove this once we're done with the debugging: #6053661 Change-Id: I4547fb71926af6dc2e9c23ee4b44e4e345be6657 --- .../inputmethod/latin/InputAttributes.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/InputAttributes.java b/java/src/com/android/inputmethod/latin/InputAttributes.java index 3de5c1d48..3298bf9cf 100644 --- a/java/src/com/android/inputmethod/latin/InputAttributes.java +++ b/java/src/com/android/inputmethod/latin/InputAttributes.java @@ -55,6 +55,7 @@ public class InputAttributes { mInputTypeNoAutoCorrect = false; mApplicationSpecifiedCompletionOn = false; } else { + dumpFlags(inputType); final int variation = inputType & InputType.TYPE_MASK_VARIATION; final boolean flagNoSuggestions = 0 != (inputType & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); @@ -95,6 +96,67 @@ public class InputAttributes { } } + private void dumpFlags(final int inputType) { + Log.i(TAG, "Input class:"); + final int inputClass = inputType & InputType.TYPE_MASK_CLASS; + if (inputClass == InputType.TYPE_CLASS_TEXT) + Log.i(TAG, " TYPE_CLASS_TEXT"); + if (inputClass == InputType.TYPE_CLASS_PHONE) + Log.i(TAG, " TYPE_CLASS_PHONE"); + if (inputClass == InputType.TYPE_CLASS_NUMBER) + Log.i(TAG, " TYPE_CLASS_NUMBER"); + if (inputClass == InputType.TYPE_CLASS_DATETIME) + Log.i(TAG, " TYPE_CLASS_DATETIME"); + Log.i(TAG, "Variation:"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS)) + Log.i(TAG, " TYPE_TEXT_VARIATION_EMAIL_ADDRESS"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT)) + Log.i(TAG, " TYPE_TEXT_VARIATION_EMAIL_SUBJECT"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_FILTER)) + Log.i(TAG, " TYPE_TEXT_VARIATION_FILTER"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE)) + Log.i(TAG, " TYPE_TEXT_VARIATION_LONG_MESSAGE"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_NORMAL)) + Log.i(TAG, " TYPE_TEXT_VARIATION_NORMAL"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_PASSWORD)) + Log.i(TAG, " TYPE_TEXT_VARIATION_PASSWORD"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_PERSON_NAME)) + Log.i(TAG, " TYPE_TEXT_VARIATION_PERSON_NAME"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_PHONETIC)) + Log.i(TAG, " TYPE_TEXT_VARIATION_PHONETIC"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS)) + Log.i(TAG, " TYPE_TEXT_VARIATION_POSTAL_ADDRESS"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE)) + Log.i(TAG, " TYPE_TEXT_VARIATION_SHORT_MESSAGE"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_URI)) + Log.i(TAG, " TYPE_TEXT_VARIATION_URI"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD)) + Log.i(TAG, " TYPE_TEXT_VARIATION_VISIBLE_PASSWORD"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT)) + Log.i(TAG, " TYPE_TEXT_VARIATION_WEB_EDIT_TEXT"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS)) + Log.i(TAG, " TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS"); + if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD)) + Log.i(TAG, " TYPE_TEXT_VARIATION_WEB_PASSWORD"); + Log.i(TAG, "Flags:"); + if (0 != (inputType & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS)) + Log.i(TAG, " TYPE_TEXT_FLAG_NO_SUGGESTIONS"); + if (0 != (inputType & InputType.TYPE_TEXT_FLAG_MULTI_LINE)) + Log.i(TAG, " TYPE_TEXT_FLAG_MULTI_LINE"); + if (0 != (inputType & InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE)) + Log.i(TAG, " TYPE_TEXT_FLAG_IME_MULTI_LINE"); + if (0 != (inputType & InputType.TYPE_TEXT_FLAG_CAP_WORDS)) + Log.i(TAG, " TYPE_TEXT_FLAG_CAP_WORDS"); + if (0 != (inputType & InputType.TYPE_TEXT_FLAG_CAP_SENTENCES)) + Log.i(TAG, " TYPE_TEXT_FLAG_CAP_SENTENCES"); + if (0 != (inputType & InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS)) + Log.i(TAG, " TYPE_TEXT_FLAG_CAP_CHARACTERS"); + if (0 != (inputType & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT)) + Log.i(TAG, " TYPE_TEXT_FLAG_AUTO_CORRECT"); + if (0 != (inputType & InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE)) + Log.i(TAG, " TYPE_TEXT_FLAG_AUTO_COMPLETE"); + } + // Pretty print @Override public String toString() {