summaryrefslogtreecommitdiff
path: root/src/org/fox/ttrss/offline/OfflineDownloadService.java
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>2013-10-17 16:33:30 +0400
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>2013-10-17 16:33:30 +0400
commit68f8880a615e92839ec718b204f7bcd685367b2f (patch)
treeb226e1d0fc324fd752ed3c7c826024330efe6580 /src/org/fox/ttrss/offline/OfflineDownloadService.java
parent0ebcf48603c1094faf648bcaece208639dd93323 (diff)
implement tasker action to download articles and go offline
Diffstat (limited to 'src/org/fox/ttrss/offline/OfflineDownloadService.java')
-rw-r--r--src/org/fox/ttrss/offline/OfflineDownloadService.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/org/fox/ttrss/offline/OfflineDownloadService.java b/src/org/fox/ttrss/offline/OfflineDownloadService.java
index e507c656..2d65c890 100644
--- a/src/org/fox/ttrss/offline/OfflineDownloadService.java
+++ b/src/org/fox/ttrss/offline/OfflineDownloadService.java
@@ -55,6 +55,7 @@ public class OfflineDownloadService extends Service {
private String m_sessionId;
private NotificationManager m_nmgr;
+ private boolean m_batchMode = false;
private boolean m_downloadInProgress = false;
private boolean m_downloadImages = false;
private int m_syncMax;
@@ -139,10 +140,19 @@ public class OfflineDownloadService extends Service {
if (!isCacheServiceRunning()) {
m_nmgr.cancel(NOTIFY_DOWNLOADING);
- Intent intent = new Intent();
- intent.setAction(INTENT_ACTION_SUCCESS);
- intent.addCategory(Intent.CATEGORY_DEFAULT);
- sendBroadcast(intent);
+ if (m_batchMode) {
+
+ SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
+ SharedPreferences.Editor editor = localPrefs.edit();
+ editor.putBoolean("offline_mode_active", true);
+ editor.commit();
+
+ } else {
+ Intent intent = new Intent();
+ intent.setAction(INTENT_ACTION_SUCCESS);
+ intent.addCategory(Intent.CATEGORY_DEFAULT);
+ sendBroadcast(intent);
+ }
} else {
updateNotification(getString(R.string.notify_downloading_images, 0));
}
@@ -473,6 +483,7 @@ public class OfflineDownloadService extends Service {
}
m_sessionId = intent.getStringExtra("sessionId");
+ m_batchMode = intent.getBooleanExtra("batchMode", false);
if (!m_downloadInProgress) {
if (m_downloadImages) ImageCacheService.cleanupCache(this, false);