diff --git a/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java b/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java index d405b782..147cb8e4 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java @@ -153,11 +153,12 @@ public class Util { } Log.i(TAG, "Failed to write test file '" + touchFile + "', " + error); - } else { - // Detected we have write permission. - Log.i(TAG, "Successfully wrote test file '" + touchFile + "'"); + return false; } + // Detected we have write permission. + Log.i(TAG, "Successfully wrote test file '" + touchFile + "'"); + // Remove test file. if (runShellCommand("rm \"" + touchFile + "\"\n", useRoot) != 0) { // This is very unlikely to happen, so we have less error handling.