Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a048a36 authored by Jacky Wang's avatar Jacky Wang Committed by Android (Google) Code Review
Browse files

Merge "Change storage_summary string id to fix crash" into main

parents 51a7f2c1 91dab36e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10910,7 +10910,7 @@ Data usage charges may apply.</string>
    <string name="apps_summary"><xliff:g id="count" example="24">%1$d</xliff:g> apps installed</string>
    <!-- Summary of storage usage [CHAR LIMIT=NONE] -->
    <string name="storage_summary"><xliff:g id="percentage" example="54%">%1$s</xliff:g> used - <xliff:g id="free_space" example="32GB">%2$s</xliff:g> free</string>
    <string name="storage_toplevel_summary"><xliff:g id="percentage" example="54%">%1$s</xliff:g> used - <xliff:g id="free_space" example="32GB">%2$s</xliff:g> free</string>
    <!-- Summary for Display settings, explaining a few important settings under it [CHAR LIMIT=NONE]-->
    <string name="display_dashboard_summary">Dark theme, font size, brightness</string>
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ public class TopLevelStoragePreferenceController extends BasePreferenceControlle
    private String getSummary(long usedBytes, long totalBytes) {
        NumberFormat percentageFormat = NumberFormat.getPercentInstance();

        return mContext.getString(R.string.storage_summary,
        return mContext.getString(R.string.storage_toplevel_summary,
                totalBytes == 0L ? "0" : percentageFormat.format(((double) usedBytes) / totalBytes),
                Formatter.formatFileSize(mContext, totalBytes - usedBytes));
    }
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public class LowStorageSlice implements CustomSliceable {
        if (usedPercentage < LOW_STORAGE_THRESHOLD) {
            // For clients that ignore error checking, a generic storage slice will be given.
            final CharSequence titleStorage = mContext.getText(R.string.storage_settings);
            final String summaryStorage = mContext.getString(R.string.storage_summary,
            final String summaryStorage = mContext.getString(R.string.storage_toplevel_summary,
                    percentageString, freeSizeString);

            return listBuilder
+1 −1
Original line number Diff line number Diff line
@@ -103,6 +103,6 @@ public class TopLevelStoragePreferenceControllerTest {
        // the background thread.
        TimeUnit.SECONDS.sleep(5);
        assertThat(preference.getSummary()).isEqualTo(ResourcesUtils.getResourcesString(
                mContext, "storage_summary", percentage, freeSpace));
                mContext, "storage_toplevel_summary", percentage, freeSpace));
    }
}