From beb9dc54a4104a08789757f277b14c57bec4460b Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 10 Mar 2015 22:04:59 +0100 Subject: [PATCH] Added toast regarding external storage usage on Kitkat and higher (ref #225). --- .../test/syncthing/SyncthingServiceTest.java | 2 +- .../syncthingandroid/activities/FolderPickerActivity.java | 7 ++++++- src/main/res/values/strings.xml | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/androidTest/java/com/nutomic/syncthingandroid/test/syncthing/SyncthingServiceTest.java b/src/androidTest/java/com/nutomic/syncthingandroid/test/syncthing/SyncthingServiceTest.java index 6e633506..06630a0c 100644 --- a/src/androidTest/java/com/nutomic/syncthingandroid/test/syncthing/SyncthingServiceTest.java +++ b/src/androidTest/java/com/nutomic/syncthingandroid/test/syncthing/SyncthingServiceTest.java @@ -69,7 +69,7 @@ public class SyncthingServiceTest extends ServiceTestCase { latch.countDown(); } }); - latch.await(5, TimeUnit.SECONDS); + latch.await(1, TimeUnit.SECONDS); assertNotNull(getService().getApi()); assertNotNull(getService().getWebGuiUrl()); } diff --git a/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java b/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java index 877b35de..a9d209cc 100644 --- a/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java @@ -74,7 +74,7 @@ public class FolderPickerActivity extends SyncthingActivity // Populate roots. ArrayList roots = new ArrayList<>(); - if (android.os.Build.VERSION.SDK_INT >= 19) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { roots.addAll(Arrays.asList(getExternalFilesDirs(null))); } roots.add(Environment.getExternalStorageDirectory()); @@ -96,6 +96,11 @@ public class FolderPickerActivity extends SyncthingActivity } else { displayRoot(); } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + Toast.makeText(this, R.string.kitkat_external_storage_warning, Toast.LENGTH_LONG) + .show(); + } } @Override diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 24275ce0..9417df7e 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -287,6 +287,9 @@ Please report any problems you encounter via Github. Folder Picker + + Warning: Your Android version does not allow syncing to external storage devices + Directory is Empty