diff options
author | Makoto Onuki <omakoto@google.com> | 2012-05-09 12:29:51 -0700 |
---|---|---|
committer | Makoto Onuki <omakoto@google.com> | 2012-05-09 12:29:51 -0700 |
commit | af3fc698cbf359f17ae658b6f1e2088472662937 (patch) | |
tree | 800f6e228f93ce6fba83a1ce48509ac8688ac5f6 /tests/src | |
parent | 69ec3afd0844994a8dd739279a55143e6437ae54 (diff) | |
download | packages_providers_ContactsProvider-af3fc698cbf359f17ae658b6f1e2088472662937.zip packages_providers_ContactsProvider-af3fc698cbf359f17ae658b6f1e2088472662937.tar.gz packages_providers_ContactsProvider-af3fc698cbf359f17ae658b6f1e2088472662937.tar.bz2 |
Handle blob in dumpCursor
This is a test-only change.
Change-Id: Ic4ed8cbae830809eb5938db78387fb969389ff2a
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/providers/contacts/TestUtils.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/src/com/android/providers/contacts/TestUtils.java b/tests/src/com/android/providers/contacts/TestUtils.java index 2d0930a..00789bf 100644 --- a/tests/src/com/android/providers/contacts/TestUtils.java +++ b/tests/src/com/android/providers/contacts/TestUtils.java @@ -73,8 +73,14 @@ public class TestUtils { for (int i = 0; i < c.getColumnCount(); i++) { if (sb.length() > 0) sb.append("|"); - // TODO Handle binary data somehow. - sb.append(c.getString(i)); + if (c.getType(i) == Cursor.FIELD_TYPE_BLOB) { + byte[] blob = c.getBlob(i); + sb.append("([blob] "); + sb.append(blob == null ? "null" : blob.length + "b"); + sb.append(")"); + } else { + sb.append(c.getString(i)); + } } Log.i(TAG, sb.toString()); } |