Remove old storage location dialogue

Signed-off-by: ZetaTom <70907959+ZetaTom@users.noreply.github.com>
This commit is contained in:
ZetaTom 2024-11-08 14:14:25 +01:00
parent 1f88ba0333
commit 7be7026fa9
No known key found for this signature in database
GPG key ID: BC815CEC88F62FBA
2 changed files with 0 additions and 49 deletions

View file

@ -57,8 +57,6 @@ import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl;
import com.owncloud.android.datamodel.ExternalLinksProvider;
import com.owncloud.android.datastorage.DataStorageProvider;
import com.owncloud.android.datastorage.StoragePoint;
import com.owncloud.android.lib.common.ExternalLink;
import com.owncloud.android.lib.common.ExternalLinkType;
import com.owncloud.android.lib.common.utils.Log_OC;
@ -129,7 +127,6 @@ public class SettingsActivity extends PreferenceActivity
private ThemeableSwitchPreference showEcosystemApps;
private AppCompatDelegate delegate;
private ListPreference prefStoragePath;
private Preference prefDataLoc;
private String storagePath;
private String pendingLock;
@ -804,34 +801,6 @@ public class SettingsActivity extends PreferenceActivity
final PreferenceCategory preferenceCategoryGeneral = (PreferenceCategory) findPreference("general");
viewThemeUtils.files.themePreferenceCategory(preferenceCategoryGeneral);
prefStoragePath = (ListPreference) findPreference(AppPreferencesImpl.STORAGE_PATH);
if (prefStoragePath != null) {
StoragePoint[] storageOptions = DataStorageProvider.getInstance().getAvailableStoragePoints();
String[] entries = new String[storageOptions.length];
String[] values = new String[storageOptions.length];
for (int i = 0; i < storageOptions.length; ++i) {
entries[i] = storageOptions[i].getDescription();
values[i] = storageOptions[i].getPath();
}
prefStoragePath.setEntries(entries);
prefStoragePath.setEntryValues(values);
prefStoragePath.setOnPreferenceChangeListener((preference, newValue) -> {
String newPath = (String) newValue;
if (storagePath.equals(newPath)) {
return true;
}
StorageMigration storageMigration = new StorageMigration(this, user, storagePath, newPath, viewThemeUtils);
storageMigration.setStorageMigrationProgressListener(this);
storageMigration.migrate();
return false;
});
}
loadStoragePath();
prefDataLoc = findPreference(AppPreferencesImpl.DATA_STORAGE_LOCATION);
if (prefDataLoc != null) {
prefDataLoc.setOnPreferenceClickListener(p -> {
@ -1159,21 +1128,6 @@ public class SettingsActivity extends PreferenceActivity
SharedPreferences.Editor editor = appPrefs.edit();
editor.putString(AppPreferencesImpl.STORAGE_PATH, storagePath);
editor.apply();
String storageDescription = DataStorageProvider.getInstance().getStorageDescriptionByPath(storagePath);
prefStoragePath.setSummary(storageDescription);
prefStoragePath.setValue(newStoragePath);
}
/**
* Load storage path set on preferences
*/
private void loadStoragePath() {
SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
// Load storage path from shared preferences. Use private internal storage by default.
storagePath = appPrefs.getString(AppPreferencesImpl.STORAGE_PATH,
getApplicationContext().getFilesDir().getAbsolutePath());
String storageDescription = DataStorageProvider.getInstance().getStorageDescriptionByPath(storagePath);
prefStoragePath.setSummary(storageDescription);
}
@Override

View file

@ -13,9 +13,6 @@
<PreferenceCategory
android:title="@string/prefs_category_general"
android:key="general">
<ListPreference
android:title="@string/prefs_data_storage_location"
android:key="storage_path"/>
<Preference
android:title="@string/prefs_data_storage_location"
android:key="data_storage_location" />