1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-07 10:42:07 +00:00

Remove pref "advanced_folder_picker", make it default to enabled (fixes #92) (#94)

Remove shared pref "advanced_folder_picker" and make it default to enabled - only relevant for Android 4.x
This commit is contained in:
Catfriend1 2018-10-13 11:54:00 +02:00 committed by GitHub
parent 85daca6eb7
commit b63eeb002b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 13 deletions

View file

@ -6,7 +6,6 @@ import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
@ -136,12 +135,9 @@ public class FolderPickerActivity extends SyncthingActivity
roots.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS));
}
// Add paths that might not be accessible to Syncthing.
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
if (sp.getBoolean("advanced_folder_picker", false)) {
Collections.addAll(roots, new File("/storage/").listFiles());
roots.add(new File("/"));
}
// Add paths where we might have read-only access.
Collections.addAll(roots, new File("/storage/").listFiles());
roots.add(new File("/"));
}
// Remove any invalid directories.
Iterator<File> it = roots.iterator();

View file

@ -818,6 +818,7 @@ public class SyncthingService extends Service {
switch (prefKey) {
// Preferences that are no longer used and left-overs from previous versions of the app.
case "first_start":
case "advanced_folder_picker":
case "notification_type":
case "notify_crashes":
Log.v(TAG, "importConfig: Ignoring deprecated pref \"" + prefKey + "\".");

View file

@ -73,12 +73,6 @@
android:summary="@string/use_root_summary"
android:defaultValue="false" />
<CheckBoxPreference
android:key="advanced_folder_picker"
android:title="@string/advanced_folder_picker"
android:summary="@string/advanced_folder_picker_summary"
android:defaultValue="false" />
<ListPreference
android:key="pref_current_language"
android:title="@string/preference_language_title"