From 47532e9d763e8631de41406625cdd73563fce42d Mon Sep 17 00:00:00 2001 From: Arc Wang Date: Fri, 19 Aug 2022 11:24:22 +0800 Subject: [PATCH] Show 'Clear storage' on customize manage space button Settings app may show 'Clear storage' button to clear data or 'Manage space' button to show app customize manage space UI. To have a consistent UI, shows 'Clear storage' button for the 2 cases. Fix: 241486222 Test: manual visual Settings -> Apps -> See all apps -> Photos -> Storage & cache Change-Id: I09f2e651a2844ef809ee269c7114296af69e6bb9 --- res/values/strings.xml | 2 -- .../android/settings/applications/AppStorageSettings.java | 6 +----- .../src/com/android/settings/widget/SwitchBarTest.java | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 9ad46800a10..6a5475b9518 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -4663,8 +4663,6 @@ This will reset all preferences for:\n\n
  • Disabled apps
  • \n
  • Disabled app notifications
  • \n
  • Default applications for actions
  • \n
  • Background data restrictions for apps
  • \n
  • Any permission restrictions
  • \n
  • Battery usage settings
  • \n\nYou will not lose any app data.
    Reset apps - - Manage space Filter diff --git a/src/com/android/settings/applications/AppStorageSettings.java b/src/com/android/settings/applications/AppStorageSettings.java index c3dc3062bba..5a1d11b405d 100644 --- a/src/com/android/settings/applications/AppStorageSettings.java +++ b/src/com/android/settings/applications/AppStorageSettings.java @@ -309,11 +309,7 @@ public class AppStorageSettings extends AppInfoWithHeader .setButton1Enabled(false); mCanClearData = false; } else { - if (appHasSpaceManagementUI) { - mButtonsPref.setButton1Text(R.string.manage_space_text); - } else { - mButtonsPref.setButton1Text(R.string.clear_user_data_text); - } + mButtonsPref.setButton1Text(R.string.clear_user_data_text); mButtonsPref.setButton1Icon(R.drawable.ic_settings_delete) .setButton1OnClickListener(v -> handleClearDataClick()); } diff --git a/tests/robotests/src/com/android/settings/widget/SwitchBarTest.java b/tests/robotests/src/com/android/settings/widget/SwitchBarTest.java index f85e1049e86..0c297f45408 100644 --- a/tests/robotests/src/com/android/settings/widget/SwitchBarTest.java +++ b/tests/robotests/src/com/android/settings/widget/SwitchBarTest.java @@ -71,7 +71,7 @@ public class SwitchBarTest { @Test public void cycleChecked_customLabel_shouldUpdateTextAndBackground() { final int onText = R.string.main_clear_progress_text; - final int offText = R.string.manage_space_text; + final int offText = R.string.clear_user_data_text; mBar.setSwitchBarText(onText, offText); assertThat(((TextView) mBar.findViewById(R.id.switch_text)).getText())