diff options
author | Elliott Hughes <enh@google.com> | 2014-10-13 16:36:46 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-13 16:36:46 +0000 |
commit | 20305d23538c75989ade544572f3b1a285277640 (patch) | |
tree | 243b38e4b46df61701217bb935c0edb879901fdc /src/com/android/providers/downloads/DownloadNotifier.java | |
parent | 252692e2a47888fff020b4ee730167fd76387aee (diff) | |
parent | ebd05f0e5afb6766050d2d85df1aaa3b37a554eb (diff) | |
download | android_packages_providers_DownloadProvider-20305d23538c75989ade544572f3b1a285277640.tar.gz android_packages_providers_DownloadProvider-20305d23538c75989ade544572f3b1a285277640.tar.bz2 android_packages_providers_DownloadProvider-20305d23538c75989ade544572f3b1a285277640.zip |
am ebd05f0e: am 3befe49d: am 250a1ebc: Fix internationalization of percentage formatting in DownloadProvider.
* commit 'ebd05f0e5afb6766050d2d85df1aaa3b37a554eb':
Fix internationalization of percentage formatting in DownloadProvider.
Diffstat (limited to 'src/com/android/providers/downloads/DownloadNotifier.java')
-rw-r--r-- | src/com/android/providers/downloads/DownloadNotifier.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/providers/downloads/DownloadNotifier.java b/src/com/android/providers/downloads/DownloadNotifier.java index bfd5568d..60c249f9 100644 --- a/src/com/android/providers/downloads/DownloadNotifier.java +++ b/src/com/android/providers/downloads/DownloadNotifier.java @@ -42,6 +42,7 @@ import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Maps; import com.google.common.collect.Multimap; +import java.text.NumberFormat; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; @@ -219,8 +220,8 @@ public class DownloadNotifier { } if (total > 0) { - final int percent = (int) ((current * 100) / total); - percentText = res.getString(R.string.download_percent, percent); + percentText = + NumberFormat.getPercentInstance().format((double) current / total); if (speed > 0) { final long remainingMillis = ((total - current) * 1000) / speed; @@ -228,6 +229,7 @@ public class DownloadNotifier { DateUtils.formatDuration(remainingMillis)); } + final int percent = (int) ((current * 100) / total); builder.setProgress(100, percent, false); } else { builder.setProgress(100, 0, true); |