diff --git a/app/src/full/java/org/fdroid/fdroid/localrepo/SwapService.java b/app/src/full/java/org/fdroid/fdroid/localrepo/SwapService.java index 57b307158..427f3a40b 100644 --- a/app/src/full/java/org/fdroid/fdroid/localrepo/SwapService.java +++ b/app/src/full/java/org/fdroid/fdroid/localrepo/SwapService.java @@ -484,7 +484,11 @@ public class SwapService extends Service { } } - private void initTimer() { + /** + * Sets or resets the idel timer for {@link #TIMEOUT}ms, once the timer + * expires, this service and all things that rely on it will be stopped. + */ + public void initTimer() { if (timer != null) { Utils.debugLog(TAG, "Cancelling existing timeout timer so timeout can be reset."); timer.cancel(); diff --git a/app/src/full/java/org/fdroid/fdroid/views/swap/SwapWorkflowActivity.java b/app/src/full/java/org/fdroid/fdroid/views/swap/SwapWorkflowActivity.java index 4939df3f4..5949b15c8 100644 --- a/app/src/full/java/org/fdroid/fdroid/views/swap/SwapWorkflowActivity.java +++ b/app/src/full/java/org/fdroid/fdroid/views/swap/SwapWorkflowActivity.java @@ -472,6 +472,8 @@ public class SwapWorkflowActivity extends AppCompatActivity { } public void inflateSwapView(@LayoutRes int viewRes) { + getSwapService().initTimer(); + container.removeAllViews(); View view = ((LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE)).inflate(viewRes, container, false); currentView = (SwapView) view;