Use DataUsageFormatter to format app data usage

Use the new unitsContentDescription from Formatter.formatBytes()

Fix: 318780411
Test: manual - on AppDataUsage
Test: unit test
Change-Id: I55079c83db2e46a48f49f746f2371825ec0bb029
This commit is contained in:
Chaohui Wang
2024-04-09 14:03:04 +08:00
parent ee501485b8
commit 7ca1ceb722
11 changed files with 161 additions and 65 deletions

View File

@@ -56,7 +56,10 @@ public final class DataUsageUtils {
/**
* Format byte value to readable string using IEC units.
*
* @deprecated Use {@link com.android.settings.datausage.lib.DataUsageFormatter} instead.
*/
@Deprecated
public static CharSequence formatDataUsage(Context context, long byteValue) {
final BytesResult res = Formatter.formatBytes(context.getResources(), byteValue,
Formatter.FLAG_IEC_UNITS);