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
This commit is contained in:
Arc Wang
2022-08-19 11:24:22 +08:00
parent 66479d6de4
commit 47532e9d76
3 changed files with 2 additions and 8 deletions

View File

@@ -4663,8 +4663,6 @@
<string name="reset_app_preferences_desc">This will reset all preferences for:\n\n<li>Disabled apps</li>\n<li>Disabled app notifications</li>\n<li>Default applications for actions</li>\n<li>Background data restrictions for apps</li>\n<li>Any permission restrictions</li>\n<li>Battery usage settings</li>\n\nYou will not lose any app data.</string> <string name="reset_app_preferences_desc">This will reset all preferences for:\n\n<li>Disabled apps</li>\n<li>Disabled app notifications</li>\n<li>Default applications for actions</li>\n<li>Background data restrictions for apps</li>\n<li>Any permission restrictions</li>\n<li>Battery usage settings</li>\n\nYou will not lose any app data.</string>
<!-- [CHAR LIMIT=25] Manage applications screen, menu item. Confirmation button of dialog to confirm resetting user's app preferences. --> <!-- [CHAR LIMIT=25] Manage applications screen, menu item. Confirmation button of dialog to confirm resetting user's app preferences. -->
<string name="reset_app_preferences_button">Reset apps</string> <string name="reset_app_preferences_button">Reset apps</string>
<!-- Manage applications screen, individual app screen, button label when the user wants to manage the space taken up by an app. -->
<string name="manage_space_text">Manage space</string>
<!-- Text for menu option in ManageApps screen to present various menu options --> <!-- Text for menu option in ManageApps screen to present various menu options -->
<string name="filter">Filter</string> <string name="filter">Filter</string>
<!-- Title of dialog for presenting filter options --> <!-- Title of dialog for presenting filter options -->

View File

@@ -308,12 +308,8 @@ public class AppStorageSettings extends AppInfoWithHeader
.setButton1Icon(R.drawable.ic_settings_delete) .setButton1Icon(R.drawable.ic_settings_delete)
.setButton1Enabled(false); .setButton1Enabled(false);
mCanClearData = false; mCanClearData = false;
} else {
if (appHasSpaceManagementUI) {
mButtonsPref.setButton1Text(R.string.manage_space_text);
} else { } else {
mButtonsPref.setButton1Text(R.string.clear_user_data_text); mButtonsPref.setButton1Text(R.string.clear_user_data_text);
}
mButtonsPref.setButton1Icon(R.drawable.ic_settings_delete) mButtonsPref.setButton1Icon(R.drawable.ic_settings_delete)
.setButton1OnClickListener(v -> handleClearDataClick()); .setButton1OnClickListener(v -> handleClearDataClick());
} }

View File

@@ -71,7 +71,7 @@ public class SwitchBarTest {
@Test @Test
public void cycleChecked_customLabel_shouldUpdateTextAndBackground() { public void cycleChecked_customLabel_shouldUpdateTextAndBackground() {
final int onText = R.string.main_clear_progress_text; 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); mBar.setSwitchBarText(onText, offText);
assertThat(((TextView) mBar.findViewById(R.id.switch_text)).getText()) assertThat(((TextView) mBar.findViewById(R.id.switch_text)).getText())