1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-09 03:31:46 +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.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
@ -136,13 +135,10 @@ public class FolderPickerActivity extends SyncthingActivity
roots.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)); roots.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS));
} }
// Add paths that might not be accessible to Syncthing. // Add paths where we might have read-only access.
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
if (sp.getBoolean("advanced_folder_picker", false)) {
Collections.addAll(roots, new File("/storage/").listFiles()); Collections.addAll(roots, new File("/storage/").listFiles());
roots.add(new File("/")); roots.add(new File("/"));
} }
}
// Remove any invalid directories. // Remove any invalid directories.
Iterator<File> it = roots.iterator(); Iterator<File> it = roots.iterator();
while (it.hasNext()) { while (it.hasNext()) {

View file

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

View file

@ -73,12 +73,6 @@
android:summary="@string/use_root_summary" android:summary="@string/use_root_summary"
android:defaultValue="false" /> 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 <ListPreference
android:key="pref_current_language" android:key="pref_current_language"
android:title="@string/preference_language_title" android:title="@string/preference_language_title"