summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-06-17 14:16:54 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-06-17 14:16:54 +0200
commit307ab0939455623b704f35849875973e4fea0708 (patch)
treea195420b19da5453420d6d29b64f84538cb427bb /src
parent9cad737be2afc219c3f670fa67bd5c3b645dee1f (diff)
downloadAntennaPod-307ab0939455623b704f35849875973e4fea0708.zip
Cancelling a download will now notify the download service
Diffstat (limited to 'src')
-rw-r--r--src/de/podfetcher/storage/DownloadRequester.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/de/podfetcher/storage/DownloadRequester.java b/src/de/podfetcher/storage/DownloadRequester.java
index 17b32bd93..6680ebda5 100644
--- a/src/de/podfetcher/storage/DownloadRequester.java
+++ b/src/de/podfetcher/storage/DownloadRequester.java
@@ -119,6 +119,7 @@ public class DownloadRequester {
downloads.remove(f);
f.setFile_url(null);
}
+ notifyDownloadService(context);
}
}
@@ -180,6 +181,7 @@ public class DownloadRequester {
* -------------
*/
private DownloadService mService = null;
+ private Context mContext = null;
boolean mIsBound;
private ServiceConnection mConnection = new ServiceConnection() {
@@ -187,10 +189,13 @@ public class DownloadRequester {
mService = ((DownloadService.LocalBinder) service).getService();
Log.d(TAG, "Connection to service established");
mService.queryDownloads();
+ mContext.unbindService(mConnection);
}
public void onServiceDisconnected(ComponentName className) {
mService = null;
+ mIsBound = false;
+ mContext = null;
Log.i(TAG, "Closed connection with DownloadService.");
}
};
@@ -199,9 +204,7 @@ public class DownloadRequester {
public void notifyDownloadService(Context context) {
context.bindService(new Intent(context, DownloadService.class),
mConnection, Context.BIND_AUTO_CREATE);
+ mContext = context;
mIsBound = true;
-
- context.unbindService(mConnection);
- mIsBound = false;
}
}