From aad57de03d05a6ffdac43bc02a16fde14a9f9795 Mon Sep 17 00:00:00 2001 From: Catfriend1 Date: Thu, 26 Jul 2018 10:23:16 +0200 Subject: [PATCH] Initialize mFolder.type to FOLDER_TYPE_SEND_RECEIVE according to the switch element having android:checked=false by default in the xml layout. --- .../activities/FolderActivity.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderActivity.java index 35d11996..67670166 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderActivity.java @@ -436,17 +436,8 @@ public class FolderActivity extends SyncthingActivity return true; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && - mFolderUri != null) { - if (mFolder == null) { - Log.e(TAG, "mFolder == null"); - } - if (mFolder.type == null) { - Log.e(TAG, "mFolder.type == null"); - } - if (mFolder.type.equals(Constants.FOLDER_TYPE_SEND_ONLY)) { - Log.e(TAG, "mFolder.type == Constants.FOLDER_TYPE_SEND_ONLY"); - } - + mFolderUri != null && + mFolder.type.equals(Constants.FOLDER_TYPE_SEND_ONLY)) { /** * Normally, syncthing takes care of creating the ".stfolder" marker. * This fails on newer android versions if the syncthing binary only has @@ -595,6 +586,7 @@ public class FolderActivity extends SyncthingActivity */ mFolder.rescanIntervalS = 3600; mFolder.paused = false; + mFolder.type = Constants.FOLDER_TYPE_SEND_RECEIVE; mFolder.versioning = new Folder.Versioning(); }