diff options
author | Daisuke Miyakawa <dmiyakawa@google.com> | 2010-11-16 14:32:25 -0800 |
---|---|---|
committer | Daisuke Miyakawa <dmiyakawa@google.com> | 2010-11-16 16:52:05 -0800 |
commit | 8bde974dac0ef49da5fda52da09952ebb4b5fd89 (patch) | |
tree | 749747394d05846d659b2c77acc03d8da872ddf1 | |
parent | b23043e3a199e951817b6d86c301b9521d4c26fe (diff) | |
download | vcard-8bde974dac0ef49da5fda52da09952ebb4b5fd89.tar.gz |
Suppress inappropriate log around VCardBuilder.
No primary/subprimary ContentValues just means there's no
ContentValues with StructuredName in a given list, so the
log tells completely wrong message to us.
Bug: 3202342
Change-Id: I5a151e850fad9335f2396cfd9edf0750e64462d4
-rw-r--r-- | java/com/android/vcard/VCardBuilder.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/java/com/android/vcard/VCardBuilder.java b/java/com/android/vcard/VCardBuilder.java index 2eec998..7fa9e92 100644 --- a/java/com/android/vcard/VCardBuilder.java +++ b/java/com/android/vcard/VCardBuilder.java @@ -255,7 +255,8 @@ public class VCardBuilder { TextUtils.isEmpty(displayName)); } - private ContentValues getPrimaryContentValue(final List<ContentValues> contentValuesList) { + private ContentValues getPrimaryContentValueWithStructuredName( + final List<ContentValues> contentValuesList) { ContentValues primaryContentValues = null; ContentValues subprimaryContentValues = null; for (ContentValues contentValues : contentValuesList) { @@ -288,7 +289,7 @@ public class VCardBuilder { // We choose the first ContentValues if any "primary" ContentValues does not exist. primaryContentValues = subprimaryContentValues; } else { - Log.e(LOG_TAG, "All ContentValues given from database is empty."); + // There's no appropriate ContentValue with StructuredName. primaryContentValues = new ContentValues(); } } @@ -319,7 +320,8 @@ public class VCardBuilder { // // e.g. How to handle non-empty phonetic names with empty structured names? - final ContentValues contentValues = getPrimaryContentValue(contentValuesList); + final ContentValues contentValues = + getPrimaryContentValueWithStructuredName(contentValuesList); String familyName = contentValues.getAsString(StructuredName.FAMILY_NAME); final String middleName = contentValues.getAsString(StructuredName.MIDDLE_NAME); final String givenName = contentValues.getAsString(StructuredName.GIVEN_NAME); @@ -422,7 +424,8 @@ public class VCardBuilder { return this; } - final ContentValues contentValues = getPrimaryContentValue(contentValuesList); + final ContentValues contentValues = + getPrimaryContentValueWithStructuredName(contentValuesList); final String familyName = contentValues.getAsString(StructuredName.FAMILY_NAME); final String middleName = contentValues.getAsString(StructuredName.MIDDLE_NAME); final String givenName = contentValues.getAsString(StructuredName.GIVEN_NAME); |