summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-06-20 23:44:30 +0100
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-06-20 23:48:07 +0100
commit7fcde1a8a300f634d9fa8e6c7266a7fedb1f141c (patch)
tree2a6f0dd25e6b4f9b235927efaf620c972936528f /core/java
parent79ee08542e22db58607d5b12420ad60c1370a503 (diff)
downloadframeworks_base-7fcde1a8a300f634d9fa8e6c7266a7fedb1f141c.zip
frameworks_base-7fcde1a8a300f634d9fa8e6c7266a7fedb1f141c.tar.gz
frameworks_base-7fcde1a8a300f634d9fa8e6c7266a7fedb1f141c.tar.bz2
Revert behavior of DateUtils.formatElapsedTime
Change Ib3c1e1aad05827df646aa18645cce19dffb7551f fixes the inability to display more that 2-digit hour values, but also changes the behavior of <10 minutes display by zero-padding the minutes. This makes the Chronometer widget look different, and breaks Holo CTS. Fix it so that for values under 600 seconds, the minutes don't get padded Change-Id: I34eb7f22e728c55bf3313ed1987ac32969cd5ed0
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/text/format/DateUtils.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/text/format/DateUtils.java b/core/java/android/text/format/DateUtils.java
index 8920b24..7872416 100644
--- a/core/java/android/text/format/DateUtils.java
+++ b/core/java/android/text/format/DateUtils.java
@@ -672,6 +672,10 @@ public class DateUtils
initFormatStrings();
if (hours > 0) {
return f.format(sElapsedFormatHMMSS, hours, minutes, seconds).toString();
+ } else if (minutes < 10) {
+ /* For MR1 Holo CTS, the minutes can't be zero-padded */
+ String FAST_FORMAT_MMSS = "%1$d:%2$02d";
+ return f.format(FAST_FORMAT_MMSS, hours, minutes, seconds).toString();
} else {
return f.format(sElapsedFormatMMSS, minutes, seconds).toString();
}