diff options
author | linyuh <linyuh@google.com> | 2018-01-22 14:39:15 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-22 16:09:52 -0800 |
commit | 861d8cd2dc75f80e5a6480145bbe29a1f5156acf (patch) | |
tree | 0c3b9a725ab90efeab606c344c13606d47b43ee4 /java/com/android/dialer/calllogutils | |
parent | 2ccd4a1f40d371100b94c676c4c39c97829e153b (diff) |
For call log entry labels, remove the dot after abbreviated time units.
The platform utility adds a dot after time units (e.g., "8 min. ago") but we prefer not to have it (e.g., "8 min ago").
Bug: 70989595
Test: CallLogDatesTest, CallLogEntryTextTest
PiperOrigin-RevId: 182838540
Change-Id: Ib8766a892aa04decb38917a6c5660804755725e0
Diffstat (limited to 'java/com/android/dialer/calllogutils')
-rw-r--r-- | java/com/android/dialer/calllogutils/CallLogDates.java | 14 | ||||
-rw-r--r-- | java/com/android/dialer/calllogutils/CallLogEntryText.java | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/java/com/android/dialer/calllogutils/CallLogDates.java b/java/com/android/dialer/calllogutils/CallLogDates.java index bdf621518..fe3c0c3ad 100644 --- a/java/com/android/dialer/calllogutils/CallLogDates.java +++ b/java/com/android/dialer/calllogutils/CallLogDates.java @@ -36,7 +36,7 @@ public final class CallLogDates { * * <pre> * if < 1 minute ago: "Just now"; - * else if < 1 hour ago: time relative to now (e.g., "8 min. ago"); + * else if < 1 hour ago: time relative to now (e.g., "8 min ago"); * else if today: time (e.g., "12:15 PM"); * else if < 7 days: abbreviated day of week (e.g., "Wed"); * else if < 1 year: date with abbreviated month, day, but no year (e.g., "Jan 15"); @@ -50,10 +50,18 @@ public final class CallLogDates { return context.getString(R.string.just_now); } - // For calls logged less than 1 hour ago, display time relative to now (e.g., "8 min. ago"). + // For calls logged less than 1 hour ago, display time relative to now (e.g., "8 min ago"). if (nowMillis - timestampMillis < TimeUnit.HOURS.toMillis(1)) { return DateUtils.getRelativeTimeSpanString( - timestampMillis, nowMillis, DateUtils.MINUTE_IN_MILLIS, DateUtils.FORMAT_ABBREV_RELATIVE); + timestampMillis, + nowMillis, + DateUtils.MINUTE_IN_MILLIS, + DateUtils.FORMAT_ABBREV_RELATIVE) + .toString() + // The platform method DateUtils#getRelativeTimeSpanString adds a dot ('.') after the + // abbreviated time unit for some languages (e.g., "8 min. ago") but we prefer not to have + // the dot. + .replace(".", ""); } int dayDifference = getDayDifference(nowMillis, timestampMillis); diff --git a/java/com/android/dialer/calllogutils/CallLogEntryText.java b/java/com/android/dialer/calllogutils/CallLogEntryText.java index 25fe86452..a7a6bba9a 100644 --- a/java/com/android/dialer/calllogutils/CallLogEntryText.java +++ b/java/com/android/dialer/calllogutils/CallLogEntryText.java @@ -58,7 +58,7 @@ public final class CallLogEntryText { * * <ul> * <li>Duo Video, Mobile • Now - * <li>Duo Video • 10 min. ago + * <li>Duo Video • 10 min ago * <li>Mobile • 11:45 PM * <li>Mobile • Sun * <li>Brooklyn, NJ • Jan 15 |