Fix variation dumping.

Variations are not flags - they should not be OR'd in this way.
Only one variation may be active at a time.

Change-Id: I9d3d4c8fc04af56c914c65f9c55f1e7b9517fc68
main
Jean Chalard 2012-11-19 19:30:47 +09:00
parent 9904c9ebbd
commit 4d0fa31779
1 changed files with 50 additions and 30 deletions

View File

@ -112,36 +112,56 @@ public final class InputAttributes {
if (inputClass == InputType.TYPE_CLASS_DATETIME) if (inputClass == InputType.TYPE_CLASS_DATETIME)
Log.i(TAG, " TYPE_CLASS_DATETIME"); Log.i(TAG, " TYPE_CLASS_DATETIME");
Log.i(TAG, "Variation:"); Log.i(TAG, "Variation:");
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS)) switch (InputType.TYPE_MASK_VARIATION & inputType) {
Log.i(TAG, " TYPE_TEXT_VARIATION_EMAIL_ADDRESS"); case InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT)) Log.i(TAG, " TYPE_TEXT_VARIATION_EMAIL_ADDRESS");
Log.i(TAG, " TYPE_TEXT_VARIATION_EMAIL_SUBJECT"); break;
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_FILTER)) case InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT:
Log.i(TAG, " TYPE_TEXT_VARIATION_FILTER"); Log.i(TAG, " TYPE_TEXT_VARIATION_EMAIL_SUBJECT");
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE)) break;
Log.i(TAG, " TYPE_TEXT_VARIATION_LONG_MESSAGE"); case InputType.TYPE_TEXT_VARIATION_FILTER:
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_NORMAL)) Log.i(TAG, " TYPE_TEXT_VARIATION_FILTER");
Log.i(TAG, " TYPE_TEXT_VARIATION_NORMAL"); break;
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_PASSWORD)) case InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE:
Log.i(TAG, " TYPE_TEXT_VARIATION_PASSWORD"); Log.i(TAG, " TYPE_TEXT_VARIATION_LONG_MESSAGE");
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_PERSON_NAME)) break;
Log.i(TAG, " TYPE_TEXT_VARIATION_PERSON_NAME"); case InputType.TYPE_TEXT_VARIATION_NORMAL:
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_PHONETIC)) Log.i(TAG, " TYPE_TEXT_VARIATION_NORMAL");
Log.i(TAG, " TYPE_TEXT_VARIATION_PHONETIC"); break;
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS)) case InputType.TYPE_TEXT_VARIATION_PASSWORD:
Log.i(TAG, " TYPE_TEXT_VARIATION_POSTAL_ADDRESS"); Log.i(TAG, " TYPE_TEXT_VARIATION_PASSWORD");
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE)) break;
Log.i(TAG, " TYPE_TEXT_VARIATION_SHORT_MESSAGE"); case InputType.TYPE_TEXT_VARIATION_PERSON_NAME:
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_URI)) Log.i(TAG, " TYPE_TEXT_VARIATION_PERSON_NAME");
Log.i(TAG, " TYPE_TEXT_VARIATION_URI"); break;
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD)) case InputType.TYPE_TEXT_VARIATION_PHONETIC:
Log.i(TAG, " TYPE_TEXT_VARIATION_VISIBLE_PASSWORD"); Log.i(TAG, " TYPE_TEXT_VARIATION_PHONETIC");
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT)) break;
Log.i(TAG, " TYPE_TEXT_VARIATION_WEB_EDIT_TEXT"); case InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS:
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS)) Log.i(TAG, " TYPE_TEXT_VARIATION_POSTAL_ADDRESS");
Log.i(TAG, " TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS"); break;
if (0 != (inputType & InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD)) case InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE:
Log.i(TAG, " TYPE_TEXT_VARIATION_WEB_PASSWORD"); Log.i(TAG, " TYPE_TEXT_VARIATION_SHORT_MESSAGE");
break;
case InputType.TYPE_TEXT_VARIATION_URI:
Log.i(TAG, " TYPE_TEXT_VARIATION_URI");
break;
case InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD:
Log.i(TAG, " TYPE_TEXT_VARIATION_VISIBLE_PASSWORD");
break;
case InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT:
Log.i(TAG, " TYPE_TEXT_VARIATION_WEB_EDIT_TEXT");
break;
case InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
Log.i(TAG, " TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS");
break;
case InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD:
Log.i(TAG, " TYPE_TEXT_VARIATION_WEB_PASSWORD");
break;
default:
Log.i(TAG, " Unknown variation");
break;
}
Log.i(TAG, "Flags:"); Log.i(TAG, "Flags:");
if (0 != (inputType & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS)) if (0 != (inputType & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS))
Log.i(TAG, " TYPE_TEXT_FLAG_NO_SUGGESTIONS"); Log.i(TAG, " TYPE_TEXT_FLAG_NO_SUGGESTIONS");