From 5153502e4a9f0e9d972a4797404787588798ffc2 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Wed, 28 Dec 2016 13:24:25 +0900 Subject: [PATCH] Improved handling of Syncthing exit codes --- .../syncthingandroid/service/SyncthingRunnable.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java b/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java index aa9da331..dfbfee6f 100644 --- a/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java +++ b/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java @@ -151,20 +151,15 @@ public class SyncthingRunnable implements Runnable { switch (ret) { case 0: - case 4: - // Valid exit codes, ignored. + case 137: + // Syncthing was shut down (via API or SIGKILL), do nothing. break; case 3: - // Restart if that was requested via Rest API call. + // Restart was requested via Rest API call. Log.i(TAG, "Restarting syncthing"); mContext.startService(new Intent(mContext, SyncthingService.class) .setAction(SyncthingService.ACTION_RESTART)); break; - case 137: - // Ignore SIGKILL that we use to stop Syncthing. - break; - case 1: - // fallthrough default: // Report Syncthing crashes, using Exception in debug mode or log in release mode. String message = "Syncthing binary crashed with error code " +