|
@@ -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
|