From 5680b01ecb566e60a63c3a3362ec31f912cef692 Mon Sep 17 00:00:00 2001 From: linyuh Date: Mon, 22 Jan 2018 11:33:01 -0800 Subject: Properly display date and/or time of entries in the new call log. Bug: 70989595 Test: CallLogDatesTest, CallLogEntryTextTest PiperOrigin-RevId: 182809700 Change-Id: I84b699536ae7f77e6c27db0b1b008e3ebc6216c2 --- java/com/android/dialer/voicemail/listui/NewVoicemailAdapter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'java/com/android/dialer/voicemail') 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 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 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; -- cgit v1.2.3