Remove Downloads backup options.

Bug: 32338407
Test: Manual -- Downloads was added before we really started adding
tests.

Change-Id: Ifd8b3dcd42e7c5c4017bdbc7e6aedcab653f216d
This commit is contained in:
Daniel Nishi
2017-02-07 16:57:04 -08:00
parent 14c2050330
commit 99228286a4
3 changed files with 0 additions and 53 deletions

View File

@@ -8006,15 +8006,6 @@
<string name="automatic_storage_manager_freed_bytes"><xliff:g id="size" example="3.25MB">%1$s</xliff:g> total made available\n\nLast ran on <xliff:g id="date" example="Jan 12">%2$s</xliff:g></string>
<!-- Dropdown preference title for dropdown describing how many days of downloads to retain.-->
<string name="automatic_storage_manager_downloads_days_title">Remove downloads</string>
<!-- Preference title for downloads backup toggle. [CHAR LIMIT=60]-->
<string name="downloads_backup_preference_title">Downloads backup</string>
<!-- Used as wall of text to describe the feature. [CHAR LIMIT=NONE] -->
<string name="downloads_backup_text"></string>
<!-- Title text for enabling web actions. [CHAR_LIMIT=60] -->
<string name="web_action_enable_title">Open links in apps</string>

View File

@@ -27,11 +27,6 @@
android:title="@string/automatic_storage_manager_preference_title"
android:summary="@string/automatic_storage_manager_text"/>
<SwitchPreference
android:key="downloads_backup_active"
android:title="@string/downloads_backup_preference_title"
android:summary="@string/downloads_backup_text"/>
<Preference
android:key="freed_bytes"
android:persistent="false"
@@ -45,14 +40,6 @@
android:entryValues="@array/automatic_storage_management_days_values"
settings:allowDividerAbove="true" />
<DropDownPreference
android:key="downloads_days"
android:summary="%s"
android:title="@string/automatic_storage_manager_downloads_days_title"
android:entries="@array/automatic_storage_management_days"
android:entryValues="@array/automatic_storage_management_days_values"
settings:allowDividerAbove="true" />
</PreferenceCategory>
<PreferenceCategory

View File

@@ -47,17 +47,13 @@ public class AutomaticStorageManagerSettings extends SettingsPreferenceFragment
private static final String KEY_DELETION_HELPER = "deletion_helper";
private static final String KEY_FREED = "freed_bytes";
private static final String KEY_STORAGE_MANAGER_SWITCH = "storage_manager_active";
private static final String KEY_DOWNLOADS_BACKUP_SWITCH = "downloads_backup_active";
private static final String KEY_DOWNLOADS_DAYS = "downloads_days";
private static final String STORAGE_MANAGER_ENABLED_BY_DEFAULT_PROPERTY =
"ro.storage_manager.enabled";
private DropDownPreference mDaysToRetain;
private DropDownPreference mDownloadsDaysToRetain;
private Preference mFreedBytes;
private Preference mDeletionHelper;
private SwitchPreference mStorageManagerSwitch;
private SwitchPreference mDownloadsBackupSwitch;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -71,9 +67,6 @@ public class AutomaticStorageManagerSettings extends SettingsPreferenceFragment
mDaysToRetain = (DropDownPreference) findPreference(KEY_DAYS);
mDaysToRetain.setOnPreferenceChangeListener(this);
mDownloadsDaysToRetain = (DropDownPreference) findPreference(KEY_DOWNLOADS_DAYS);
mDownloadsDaysToRetain.setOnPreferenceChangeListener(this);
mFreedBytes = findPreference(KEY_FREED);
mDeletionHelper = findPreference(KEY_DELETION_HELPER);
@@ -82,9 +75,6 @@ public class AutomaticStorageManagerSettings extends SettingsPreferenceFragment
mStorageManagerSwitch = (SwitchPreference) findPreference(KEY_STORAGE_MANAGER_SWITCH);
mStorageManagerSwitch.setOnPreferenceChangeListener(this);
mDownloadsBackupSwitch = (SwitchPreference) findPreference(KEY_DOWNLOADS_BACKUP_SWITCH);
mDownloadsBackupSwitch.setOnPreferenceChangeListener(this);
ContentResolver cr = getContentResolver();
int photosDaysToRetain = Settings.Secure.getInt(cr,
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
@@ -93,12 +83,6 @@ public class AutomaticStorageManagerSettings extends SettingsPreferenceFragment
getResources().getStringArray(R.array.automatic_storage_management_days_values);
mDaysToRetain.setValue(stringValues[daysValueToIndex(photosDaysToRetain, stringValues)]);
int downloadsDaysToRetain = Settings.Secure.getInt(cr,
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_DOWNLOADS_DAYS_TO_RETAIN,
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT);
mDownloadsDaysToRetain.setValue(stringValues[daysValueToIndex(downloadsDaysToRetain,
stringValues)]);
long freedBytes = Settings.Secure.getLong(cr,
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED,
0);
@@ -124,11 +108,6 @@ public class AutomaticStorageManagerSettings extends SettingsPreferenceFragment
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_ENABLED, 0) != 0;
mStorageManagerSwitch.setChecked(isStorageManagerChecked);
mDaysToRetain.setEnabled(isStorageManagerChecked);
boolean isDownloadsBackupChecked =
Settings.Secure.getInt(getContentResolver(),
Settings.Secure.DOWNLOADS_BACKUP_ENABLED, 0) != 0;
mDownloadsBackupSwitch.setChecked(isDownloadsBackupChecked);
}
@Override
@@ -147,21 +126,11 @@ public class AutomaticStorageManagerSettings extends SettingsPreferenceFragment
maybeShowWarning();
}
break;
case KEY_DOWNLOADS_BACKUP_SWITCH:
boolean downloadsBackupChecked = (boolean) newValue;
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.DOWNLOADS_BACKUP_ENABLED, downloadsBackupChecked ? 1 : 0);
break;
case KEY_DAYS:
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
Integer.parseInt((String) newValue));
break;
case KEY_DOWNLOADS_DAYS:
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_DOWNLOADS_DAYS_TO_RETAIN,
Integer.parseInt((String) newValue));
break;
}
return true;
}