1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-27 05:11:30 +00:00

Improved handling of Syncthing exit codes

This commit is contained in:
Felix Ableitner 2016-12-28 13:24:25 +09:00
parent 3e4effa7c6
commit 5153502e4a

View file

@ -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 " +