summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/deviceinfo
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-06-15 10:11:46 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-06-15 10:11:46 -0700
commit30f5b68b7543489c7415de7cf4d2e458507072a1 (patch)
treeb335f376ac60d30a0b9e75e19c09bb1b1e202a9f /src/com/android/settings/deviceinfo
parentd43446058378dc965d5568139f07979a9759445f (diff)
parenta78edb54182da5881f2f1e6bc76ae027a9a6f3e3 (diff)
downloadpackages_apps_Settings-30f5b68b7543489c7415de7cf4d2e458507072a1.tar.gz
packages_apps_Settings-30f5b68b7543489c7415de7cf4d2e458507072a1.tar.bz2
packages_apps_Settings-30f5b68b7543489c7415de7cf4d2e458507072a1.zip
am a78edb54: Merge change 4127 into donut
Merge commit 'a78edb54182da5881f2f1e6bc76ae027a9a6f3e3' * commit 'a78edb54182da5881f2f1e6bc76ae027a9a6f3e3': Make the SD Card settings use the system file size formatter.
Diffstat (limited to 'src/com/android/settings/deviceinfo')
-rw-r--r--src/com/android/settings/deviceinfo/Memory.java21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/com/android/settings/deviceinfo/Memory.java b/src/com/android/settings/deviceinfo/Memory.java
index 75a84b719..53e2a69c9 100644
--- a/src/com/android/settings/deviceinfo/Memory.java
+++ b/src/com/android/settings/deviceinfo/Memory.java
@@ -31,6 +31,7 @@ import android.os.StatFs;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
+import android.text.format.Formatter;
import android.util.Log;
import com.android.settings.R;
@@ -194,25 +195,7 @@ public class Memory extends PreferenceActivity {
}
private String formatSize(long size) {
- String suffix = null;
-
- // add KB or MB suffix if size is greater than 1K or 1M
- if (size >= 1024) {
- suffix = " KB";
- size /= 1024;
- if (size >= 1024) {
- suffix = " MB";
- size /= 1024;
- }
- }
-
- DecimalFormat formatter = new DecimalFormat();
- formatter.setGroupingSize(3);
- String result = formatter.format(size);
-
- if (suffix != null)
- result = result + suffix;
- return result;
+ return Formatter.formatFileSize(this, size);
}
}