1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-22 20:31:16 +00:00

Moved syncthing shutdown hack to updateState() so it's invoked on every start.

This commit is contained in:
Felix Ableitner 2014-09-28 20:57:47 +03:00
parent 2b5435c1e8
commit 78680eceb1

View file

@ -153,6 +153,11 @@ public class SyncthingService extends Service {
return; return;
} }
// HACK: Make sure there is no syncthing binary left running from an improper
// shutdown (eg Play Store update).
// NOTE: This will log an exception if syncthing is not actually running.
mApi.shutdown();
mCurrentState = State.STARTING; mCurrentState = State.STARTING;
registerOnWebGuiAvailableListener(mApi); registerOnWebGuiAvailableListener(mApi);
new PollWebGuiAvailableTaskImpl().execute(mConfig.getWebGuiUrl()); new PollWebGuiAvailableTaskImpl().execute(mConfig.getWebGuiUrl());
@ -256,11 +261,6 @@ public class SyncthingService extends Service {
}); });
registerOnWebGuiAvailableListener(mApi); registerOnWebGuiAvailableListener(mApi);
Log.i(TAG, "Web GUI will be available at " + mConfig.getWebGuiUrl()); Log.i(TAG, "Web GUI will be available at " + mConfig.getWebGuiUrl());
// HACK: Make sure there is no syncthing binary left running from an improper
// shutdown (eg Play Store update).
// NOTE: This will log an exception if syncthing is not actually running.
mApi.shutdown();
updateState(); updateState();
} }
} }