From b63eeb002bd6f7b3f54e9c2c0d3321d68e87553e Mon Sep 17 00:00:00 2001 From: Catfriend1 Date: Sat, 13 Oct 2018 11:54:00 +0200 Subject: [PATCH] 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 --- .../activities/FolderPickerActivity.java | 10 +++------- .../syncthingandroid/service/SyncthingService.java | 1 + app/src/main/res/xml/app_settings.xml | 6 ------ 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java index 731960b0..a832391c 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java @@ -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 it = roots.iterator(); diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java b/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java index fbea0363..778dab0f 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java @@ -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 + "\"."); diff --git a/app/src/main/res/xml/app_settings.xml b/app/src/main/res/xml/app_settings.xml index 29ae1758..0ce25afa 100644 --- a/app/src/main/res/xml/app_settings.xml +++ b/app/src/main/res/xml/app_settings.xml @@ -73,12 +73,6 @@ android:summary="@string/use_root_summary" android:defaultValue="false" /> - -