summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/voicemail
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-01-22 11:33:01 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-22 11:54:23 -0800
commit5680b01ecb566e60a63c3a3362ec31f912cef692 (patch)
tree14dd875eb4e6aab3c01ce710cce31fb027815379 /java/com/android/dialer/voicemail
parent0ccdb420e23dbb8c78de0b5f54a86f3bea2b20e1 (diff)
Properly display date and/or time of entries in the new call log.
Bug: 70989595 Test: CallLogDatesTest, CallLogEntryTextTest PiperOrigin-RevId: 182809700 Change-Id: I84b699536ae7f77e6c27db0b1b008e3ebc6216c2
Diffstat (limited to 'java/com/android/dialer/voicemail')
-rw-r--r--java/com/android/dialer/voicemail/listui/NewVoicemailAdapter.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailAdapter.java b/java/com/android/dialer/voicemail/listui/NewVoicemailAdapter.java
index 86d386050..c9bf6e1a8 100644
--- a/java/com/android/dialer/voicemail/listui/NewVoicemailAdapter.java
+++ b/java/com/android/dialer/voicemail/listui/NewVoicemailAdapter.java
@@ -104,7 +104,7 @@ final class NewVoicemailAdapter extends RecyclerView.Adapter<ViewHolder>
private final NewVoicemailMediaPlayer mediaPlayer =
new NewVoicemailMediaPlayer(new MediaPlayer());
- /** @param cursor whose projection is {@link VoicemailCursorLoader.VOICEMAIL_COLUMNS} */
+ /** @param cursor whose projection is {@link VoicemailCursorLoader#VOICEMAIL_COLUMNS} */
NewVoicemailAdapter(Cursor cursor, Clock clock, FragmentManager fragmentManager) {
LogUtil.enterBlock("NewVoicemailAdapter");
this.cursor = cursor;
@@ -133,14 +133,14 @@ final class NewVoicemailAdapter extends RecyclerView.Adapter<ViewHolder>
long currentTimeMillis = clock.currentTimeMillis();
if (cursor.moveToNext()) {
long firstTimestamp = VoicemailCursorLoader.getTimestamp(cursor);
- if (CallLogDates.isSameDay(currentTimeMillis, firstTimestamp)) {
+ if (CallLogDates.getDayDifference(currentTimeMillis, firstTimestamp) == 0) {
this.todayHeaderPosition = 0 + alertOffSet;
int adapterPosition =
2 + alertOffSet; // Accounted for the "Alert", "Today" header and first row.
while (cursor.moveToNext()) {
long timestamp = VoicemailCursorLoader.getTimestamp(cursor);
- if (CallLogDates.isSameDay(currentTimeMillis, timestamp)) {
+ if (CallLogDates.getDayDifference(currentTimeMillis, timestamp) == 0) {
adapterPosition++;
} else {
this.olderHeaderPosition = adapterPosition;