diff options
Diffstat (limited to 'java/com/android/voicemail/impl/imap')
-rw-r--r-- | java/com/android/voicemail/impl/imap/ImapHelper.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/java/com/android/voicemail/impl/imap/ImapHelper.java b/java/com/android/voicemail/impl/imap/ImapHelper.java index f1bc8b221..94abe9bad 100644 --- a/java/com/android/voicemail/impl/imap/ImapHelper.java +++ b/java/com/android/voicemail/impl/imap/ImapHelper.java @@ -251,13 +251,18 @@ public class ImapHelper implements Closeable { long time = messageDetails.getSentDate().getTime(); String number = getNumber(messageDetails.getFrom()); boolean isRead = Arrays.asList(messageDetails.getFlags()).contains(Flag.SEEN); - return Voicemail.createForInsertion(time, number) - .setPhoneAccount(mPhoneAccount) - .setSourcePackage(mContext.getPackageName()) - .setSourceData(messageDetails.getUid()) - .setIsRead(isRead) - .setTranscription(listener.getVoicemailTranscription()) - .build(); + Long duration = messageDetails.getDuration(); + Voicemail.Builder builder = + Voicemail.createForInsertion(time, number) + .setPhoneAccount(mPhoneAccount) + .setSourcePackage(mContext.getPackageName()) + .setSourceData(messageDetails.getUid()) + .setIsRead(isRead) + .setTranscription(listener.getVoicemailTranscription()); + if (duration != null) { + builder.setDuration(duration); + } + return builder.build(); } /** |