From 8b778bdcb4e8a5b3a622405203271496f8f25c32 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 31 Oct 2016 18:27:03 +0900 Subject: [PATCH] Moved BINARY_NAME constant into SyncthingRunnable --- .../syncthingandroid/service/SyncthingRunnable.java | 9 +++++++-- .../syncthingandroid/service/SyncthingService.java | 5 ----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java b/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java index 7f8b22e9..e22862f9 100644 --- a/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java +++ b/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java @@ -39,6 +39,11 @@ public class SyncthingRunnable implements Runnable { public static final String UNIT_TEST_PATH = "was running"; + /** + * Path to the native, integrated syncthing binary, relative to the data folder + */ + public static final String BINARY_NAME = "lib/libsyncthing.so"; + private static final AtomicReference mSyncthing = new AtomicReference<>(); private final Context mContext; @@ -62,7 +67,7 @@ public class SyncthingRunnable implements Runnable { */ public SyncthingRunnable(Context context, Command command) { mContext = context; - mSyncthingBinary = mContext.getApplicationInfo().dataDir + "/" + SyncthingService.BINARY_NAME; + mSyncthingBinary = mContext.getApplicationInfo().dataDir + "/" + BINARY_NAME; switch (command) { case generate: mCommand = new String[]{ mSyncthingBinary, "-generate", mContext.getFilesDir().toString() }; @@ -85,7 +90,7 @@ public class SyncthingRunnable implements Runnable { */ public SyncthingRunnable(Context context, String[] manualCommand) { mContext = context; - mSyncthingBinary = mContext.getApplicationInfo().dataDir + "/" + SyncthingService.BINARY_NAME; + mSyncthingBinary = mContext.getApplicationInfo().dataDir + "/" + BINARY_NAME; mCommand = manualCommand; } diff --git a/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java b/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java index 64eaede5..abc196e8 100644 --- a/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java +++ b/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java @@ -83,11 +83,6 @@ public class SyncthingService extends Service implements public static final File EXPORT_PATH = new File(Environment.getExternalStorageDirectory(), "backups/syncthing"); - /** - * path to the native, integrated syncthing binary, relative to the data folder - */ - public static final String BINARY_NAME = "lib/libsyncthing.so"; - public static final String PREF_ALWAYS_RUN_IN_BACKGROUND = "always_run_in_background"; public static final String PREF_SYNC_ONLY_WIFI = "sync_only_wifi"; public static final String PREF_SYNC_ONLY_WIFI_SSIDS = "sync_only_wifi_ssids_set";