diff options
author | Bjorn Bringert <bringert@android.com> | 2010-11-23 14:43:12 +0000 |
---|---|---|
committer | Bjorn Bringert <bringert@android.com> | 2010-11-23 14:43:12 +0000 |
commit | 901b3796fd0954cc4b01bf95dbcbd88d87414e84 (patch) | |
tree | a14327f75a435c39ef1c47b51176c4370346f2cd /core/java | |
parent | 1c24e957ad8624753f9d89b578d9d34d7ac5f80b (diff) | |
download | frameworks_base-901b3796fd0954cc4b01bf95dbcbd88d87414e84.zip frameworks_base-901b3796fd0954cc4b01bf95dbcbd88d87414e84.tar.gz frameworks_base-901b3796fd0954cc4b01bf95dbcbd88d87414e84.tar.bz2 |
Don't drop zeros in the second position in formatDuration()
Bug: 3223250
Change-Id: I462c96af51cc052f9df1dc3d2c668551b10155ea
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/util/TimeUtils.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/java/android/util/TimeUtils.java b/core/java/android/util/TimeUtils.java index 60ca384..85ce5e1 100644 --- a/core/java/android/util/TimeUtils.java +++ b/core/java/android/util/TimeUtils.java @@ -158,18 +158,17 @@ public class TimeUtils { static private int printField(char[] formatStr, int amt, char suffix, int pos, boolean always, int zeropad) { if (always || amt > 0) { + final int startPos = pos; if ((always && zeropad >= 3) || amt > 99) { int dig = amt/100; formatStr[pos] = (char)(dig + '0'); pos++; - always = true; amt -= (dig*100); } - if ((always && zeropad >= 2) || amt > 9) { + if ((always && zeropad >= 2) || amt > 9 || startPos != pos) { int dig = amt/10; formatStr[pos] = (char)(dig + '0'); pos++; - always = true; amt -= (dig*10); } formatStr[pos] = (char)(amt + '0'); |