summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorBjorn Bringert <bringert@android.com>2010-11-24 03:25:17 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-11-24 03:25:17 -0800
commit93fbae34ce8b6a1907b6f1daf42f17e3f0025346 (patch)
tree2f72b8bed6a36be6f2d6de5d816ee62fe135feb8 /core/java/android
parent4ffb3e097dc7be005af40989cc3717a1fb0e1489 (diff)
parent901b3796fd0954cc4b01bf95dbcbd88d87414e84 (diff)
downloadframeworks_base-93fbae34ce8b6a1907b6f1daf42f17e3f0025346.zip
frameworks_base-93fbae34ce8b6a1907b6f1daf42f17e3f0025346.tar.gz
frameworks_base-93fbae34ce8b6a1907b6f1daf42f17e3f0025346.tar.bz2
Merge "Don't drop zeros in the second position in formatDuration()"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/util/TimeUtils.java5
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');