diff --git a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java index fa21f9f02..192ee04c9 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java @@ -169,17 +169,21 @@ public void onStart(Intent intent) { new Thread(new Runnable(){ @Override public void run() { + boolean locked = false; try { // Make sure everything is ready to go before handling event if(!setup.get()) { + locked = true; lock.lock(); } handleKeyEvent(event); } finally { - lock.unlock(); + if(locked) { + lock.unlock(); + } } } - }); + }).start(); } } }