From d83060975cd40302eb3e467a8650e32a071fcab8 Mon Sep 17 00:00:00 2001 From: Catfriend1 Date: Sun, 24 Jun 2018 12:37:06 +0200 Subject: [PATCH] Fix warning about missing write perm in root mode (fixes #1165) (#1166) --- .../syncthingandroid/activities/FolderPickerActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 0075447e..8581d4dd 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java @@ -31,6 +31,7 @@ import android.widget.Toast; import com.google.common.collect.Sets; import com.nutomic.syncthingandroid.R; import com.nutomic.syncthingandroid.SyncthingApp; +import com.nutomic.syncthingandroid.service.Constants; import com.nutomic.syncthingandroid.service.SyncthingService; import com.nutomic.syncthingandroid.service.SyncthingServiceBinder; import com.nutomic.syncthingandroid.util.Util; @@ -102,7 +103,8 @@ public class FolderPickerActivity extends SyncthingActivity displayRoot(); } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + Boolean prefUseRoot = PreferenceManager.getDefaultSharedPreferences(this).getBoolean(Constants.PREF_USE_ROOT, false); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && !prefUseRoot) { Toast.makeText(this, R.string.kitkat_external_storage_warning, Toast.LENGTH_LONG) .show(); }