From 7d5c3dc764a355295d5ca4f4faec94faa53293a6 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Thu, 30 Jan 2025 10:40:23 +1100 Subject: [PATCH] Fix Settings/Storage "Format USB drive" title string Historically, this activity fragment had a "Format SD card for portable storage" title string and the body text linked to https://support.google.com/android/answer/12153449 which discusses portable versus internal storage for SD cards. For desktop Android, it is increasingly common to insert USB drives instead of SD cards and the "portable versus internal" user decision is less relevant here. This commit drops that link when not formatting an SD card. It also affects the title string, selecting between "Format SD card for portable storage" and "Format USB drive". Some StorageWizardFoo activity fragments' strings already made the SD card / USB drive distinction. This commit makes it a little more consistent. Bug: 373737145 Flag: EXEMPT minor fix Test: manual Change-Id: I3cf4b192e30566d5acb722b1d45cf14c5041706c --- res/values/strings.xml | 4 +++- .../deviceinfo/StorageWizardInit.java | 22 +++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index ddf69813aa1..5d4977cf6dc 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3547,6 +3547,8 @@ Format SD card for portable storage Store photos, videos, music, and more and access them from other devices. <a href="https://support.google.com/android/answer/12153449">Learn more about setting up an SD card</a>. + + Store photos, videos, music, and more and access them from other devices. Format @@ -3560,7 +3562,7 @@ This ^1 needs to be formatted to store photos, videos, music, and more. \n\nFormatting will erase existing content on the ^2. To avoid losing content, back it up to another ^3 or device. - + Format ^1 diff --git a/src/com/android/settings/deviceinfo/StorageWizardInit.java b/src/com/android/settings/deviceinfo/StorageWizardInit.java index b912ffe4958..17ab4e73d4f 100644 --- a/src/com/android/settings/deviceinfo/StorageWizardInit.java +++ b/src/com/android/settings/deviceinfo/StorageWizardInit.java @@ -76,8 +76,11 @@ public class StorageWizardInit extends StorageWizardBase { } if(mPortable) { mFlipper.setDisplayedChild(0); - setHeaderText(R.string.storage_wizard_init_v2_external_title, - getDiskShortDescription()); + setHeaderText( + ((mDisk != null) && mDisk.isSd()) + ? R.string.storage_wizard_init_v2_external_title + : R.string.storage_wizard_format_confirm_v2_action, + getDiskShortDescription()); setNextButtonText(R.string.storage_wizard_init_v2_external_action); setBackButtonText(R.string.wizard_back_adoptable); setNextButtonVisibility(View.VISIBLE); @@ -104,8 +107,11 @@ public class StorageWizardInit extends StorageWizardBase { v.setEnabled(false); } else if (mPortable == false) { mFlipper.showNext(); - setHeaderText(R.string.storage_wizard_init_v2_external_title, - getDiskShortDescription()); + setHeaderText( + ((mDisk != null) && mDisk.isSd()) + ? R.string.storage_wizard_init_v2_external_title + : R.string.storage_wizard_format_confirm_v2_action, + getDiskShortDescription()); setNextButtonText(R.string.storage_wizard_init_v2_external_action); setBackButtonText(R.string.wizard_back_adoptable); setBackButtonVisibility(View.VISIBLE); @@ -151,8 +157,10 @@ public class StorageWizardInit extends StorageWizardBase { private void setupHyperlink() { TextView external_storage_textview = findViewById(R.id.storage_wizard_init_external_text); TextView internal_storage_textview = findViewById(R.id.storage_wizard_init_internal_text); - String external_storage_text = getResources().getString(R.string. - storage_wizard_init_v2_external_summary); + String external_storage_text = getResources().getString( + ((mDisk != null) && mDisk.isSd()) + ? R.string.storage_wizard_init_v2_external_summary + : R.string.storage_wizard_init_v2_external_summary_non_sd_card); String internal_storage_text = getResources().getString(R.string. storage_wizard_init_v2_internal_summary); @@ -193,4 +201,4 @@ public class StorageWizardInit extends StorageWizardBase { || event.getY() > v.getMeasuredHeight()); } }; -} \ No newline at end of file +}