From bbd637d3914f61c85a838443e61b7f099d8243af Mon Sep 17 00:00:00 2001 From: Chalard Jean Date: Tue, 28 Jan 2020 20:22:45 +0900 Subject: [PATCH] Use IEC units in app info data usage. Settings > Apps & notifications > select some app that has done some internet traffic. Observe "Mobile data & Wi-Fi" summary data and take note of the numbers. Then tap on it and observe that the numbers on the details page don't match the one in the summary. This is because the details use IEC units while the summary uses SI units. This fix changes the summary to use IEC units too, removing the discrepancy. Bug: 137917003 Test: manually cause some traffic, see that the numbers are now consistent between the app info and usage details page Change-Id: I4be5830d4e98a1c4739001c812e59d82415bf24a --- .../applications/appinfo/AppDataUsagePreferenceController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceController.java b/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceController.java index 4d19151dbc9..a3ea4784b28 100644 --- a/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceController.java +++ b/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceController.java @@ -127,7 +127,7 @@ public class AppDataUsagePreferenceController extends AppInfoPreferenceControlle return mContext.getString(R.string.no_data_usage); } return mContext.getString(R.string.data_summary_format, - Formatter.formatFileSize(mContext, totalBytes), + Formatter.formatFileSize(mContext, totalBytes, Formatter.FLAG_IEC_UNITS), DateUtils.formatDateTime(mContext, startTime, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_MONTH)); }