Merge "Revert "[L10n fix] Use whitespace regex for splitting string by delimiter."" into main

This commit is contained in:
Garvita Jain
2025-03-14 01:02:05 -07:00
committed by Android (Google) Code Review
3 changed files with 3 additions and 3 deletions

View File

@@ -93,7 +93,7 @@ public class TopLevelStoragePreferenceController extends BasePreferenceControlle
private String getSummary(long usedBytes, long totalBytes) { private String getSummary(long usedBytes, long totalBytes) {
NumberFormat percentageFormat = NumberFormat.getPercentInstance(); NumberFormat percentageFormat = NumberFormat.getPercentInstance();
final String[] freeSpace = final String[] freeSpace =
Formatter.formatFileSize(mContext, totalBytes - usedBytes).split("\\s"); Formatter.formatFileSize(mContext, totalBytes - usedBytes).split(" ");
return mContext.getString(R.string.storage_summary, return mContext.getString(R.string.storage_summary,
totalBytes == 0L ? "0" : percentageFormat.format(((double) usedBytes) / totalBytes), totalBytes == 0L ? "0" : percentageFormat.format(((double) usedBytes) / totalBytes),
freeSpace[0], freeSpace[1]); freeSpace[0], freeSpace[1]);

View File

@@ -65,7 +65,7 @@ public class LowStorageSlice implements CustomSliceable {
// Generate Low storage Slice. // Generate Low storage Slice.
final String percentageString = NumberFormat.getPercentInstance().format(usedPercentage); final String percentageString = NumberFormat.getPercentInstance().format(usedPercentage);
final String[] freeSizeString = final String[] freeSizeString =
Formatter.formatFileSize(mContext, info.freeBytes).split("\\s"); Formatter.formatFileSize(mContext, info.freeBytes).split(" ");
final ListBuilder listBuilder = new ListBuilder(mContext, final ListBuilder listBuilder = new ListBuilder(mContext,
CustomSliceRegistry.LOW_STORAGE_SLICE_URI, ListBuilder.INFINITY).setAccentColor( CustomSliceRegistry.LOW_STORAGE_SLICE_URI, ListBuilder.INFINITY).setAccentColor(

View File

@@ -86,7 +86,7 @@ public class TopLevelStoragePreferenceControllerTest {
when(mController.getStorageManagerVolumeProvider()) when(mController.getStorageManagerVolumeProvider())
.thenReturn(mStorageManagerVolumeProvider); .thenReturn(mStorageManagerVolumeProvider);
final String percentage = NumberFormat.getPercentInstance().format(1); final String percentage = NumberFormat.getPercentInstance().format(1);
final String[] freeSpace = Formatter.formatFileSize(mContext, 0).split("\\s"); final String[] freeSpace = Formatter.formatFileSize(mContext, 0).split(" ");
final Preference preference = new Preference(mContext); final Preference preference = new Preference(mContext);
// Wait for asynchronous thread to finish, otherwise test will flake. // Wait for asynchronous thread to finish, otherwise test will flake.