diff options
author | Andy Huang <ath@google.com> | 2012-12-06 16:04:58 -0800 |
---|---|---|
committer | Andy Huang <ath@google.com> | 2012-12-06 20:17:06 -0800 |
commit | 351ad4e87e0b0b98df9ca88266a8a63541dc5a81 (patch) | |
tree | 825017c1af4dcd2f12568d6fff4a03dc7dcdf121 /tests/src | |
parent | 5ffe7cefec82e48fc1820fe0818d39c2100f044d (diff) | |
download | android_packages_apps_UnifiedEmail-351ad4e87e0b0b98df9ca88266a8a63541dc5a81.tar.gz android_packages_apps_UnifiedEmail-351ad4e87e0b0b98df9ca88266a8a63541dc5a81.tar.bz2 android_packages_apps_UnifiedEmail-351ad4e87e0b0b98df9ca88266a8a63541dc5a81.zip |
use parcel intermediate format for ConversationInfo
Instead of passing ConversationInfo/MessageInfo around as
Strings from provider->UI, use Cursor's blob functionality where
the blob is the marshalled form of the parceled Info objects.
This should be a acceptable use of Parcel, given that we are not
persisting this form, and it only exists to facilitate
provider/UI communication through the generic Cursor interface.
Parcel blobs are fast, well-tested, and do not require
input sanitization.
Traceview testing reveals pretty good gains in Conversation
construction (29% faster on Nexus 7), which is most of the work
in getView().
Change-Id: I05451fba2201ca2f2c3ee76c80fb356c36e8ccad
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/mail/browse/SendersFormattingTests.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/src/com/android/mail/browse/SendersFormattingTests.java b/tests/src/com/android/mail/browse/SendersFormattingTests.java index a4d9881a9..3637e8f10 100644 --- a/tests/src/com/android/mail/browse/SendersFormattingTests.java +++ b/tests/src/com/android/mail/browse/SendersFormattingTests.java @@ -93,9 +93,9 @@ public class SendersFormattingTests extends AndroidTestCase { final MessageInfo msg = new MessageInfo(false, false, "****^****", 0); conv.addMessage(msg); - final String serialized = ConversationInfo.toString(conv); + final byte[] serialized = conv.toBlob(); - ConversationInfo conv2 = ConversationInfo.fromString(serialized); + ConversationInfo conv2 = ConversationInfo.fromBlob(serialized); assertEquals(1, conv2.messageInfos.size()); assertEquals(msg.sender, conv2.messageInfos.get(0).sender); } @@ -114,9 +114,9 @@ public class SendersFormattingTests extends AndroidTestCase { assertEquals(firstUnreadSnippet, conv.firstUnreadSnippet); assertEquals(lastSnippet, conv.lastSnippet); - final String serialized = ConversationInfo.toString(conv); + final byte[] serialized = conv.toBlob(); - ConversationInfo conv2 = ConversationInfo.fromString(serialized); + ConversationInfo conv2 = ConversationInfo.fromBlob(serialized); assertEquals(conv.firstSnippet, conv2.firstSnippet); assertEquals(conv.firstUnreadSnippet, conv2.firstUnreadSnippet); |