summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllogutils/CallLogEntryText.java
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/calllogutils/CallLogEntryText.java
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/calllogutils/CallLogEntryText.java')
-rw-r--r--java/com/android/dialer/calllogutils/CallLogEntryText.java31
1 files changed, 17 insertions, 14 deletions
diff --git a/java/com/android/dialer/calllogutils/CallLogEntryText.java b/java/com/android/dialer/calllogutils/CallLogEntryText.java
index 1df44583f..25fe86452 100644
--- a/java/com/android/dialer/calllogutils/CallLogEntryText.java
+++ b/java/com/android/dialer/calllogutils/CallLogEntryText.java
@@ -49,22 +49,25 @@ public final class CallLogEntryText {
return primaryText.toString();
}
- /** The secondary text to show in the main call log entry list. */
+ /**
+ * The secondary text to show in the main call log entry list.
+ *
+ * <p>Rules: (Duo video, )?$Label|$Location • Date
+ *
+ * <p>Examples:
+ *
+ * <ul>
+ * <li>Duo Video, Mobile • Now
+ * <li>Duo Video • 10 min. ago
+ * <li>Mobile • 11:45 PM
+ * <li>Mobile • Sun
+ * <li>Brooklyn, NJ • Jan 15
+ * </ul>
+ *
+ * <p>See {@link CallLogDates#newCallLogTimestampLabel(Context, long, long)} for date rules.
+ */
public static CharSequence buildSecondaryTextForEntries(
Context context, Clock clock, CoalescedRow row) {
- /*
- * Rules: (Duo video, )?$Label|$Location • Date
- *
- * Examples:
- * Duo Video, Mobile • Now
- * Duo Video • 11:45pm
- * Mobile • 11:45pm
- * Mobile • Sunday
- * Brooklyn, NJ • Jan 15
- *
- * Date rules:
- * if < 1 minute ago: "Now"; else if today: HH:MM(am|pm); else if < 3 days: day; else: MON D
- */
StringBuilder secondaryText = secondaryTextPrefix(context, row);
if (secondaryText.length() > 0) {