aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-10-20 16:22:46 -0700
committerScott Jackson <daneren2005@gmail.com>2014-10-20 16:22:46 -0700
commitb943aabed7828afb92162f52f44788d732d14811 (patch)
tree64c18442c997c7b1067a406f1c88101e24f5e750 /src/github
parent07b90a9663d4becac54efef2463f87d22e8a57c3 (diff)
downloaddsub-b943aabed7828afb92162f52f44788d732d14811.tar.gz
dsub-b943aabed7828afb92162f52f44788d732d14811.tar.bz2
dsub-b943aabed7828afb92162f52f44788d732d14811.zip
#386 Add logic to actually change online status, shuffle options
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java
index 13c3cea7..32919aff 100644
--- a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java
+++ b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java
@@ -167,8 +167,33 @@ public class DownloadServiceLifecycleSupport {
lock.lock();
lock.unlock();
}
+
+ short offline = intent.getShortExtra(Constants.INTENT_EXTRA_OFFLINE, 0);
+ if(offline != 0) {
+ boolean offline = (offline == 2);
+ Util.setOffline(context, offline);
+ downloadService.setOnline(!offline);
+ }
if(intent.getBooleanExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE, false)) {
+ // Add shuffle parameters
+ SharedPreferences.Editor editor = Util.getPreferences(context).edit();
+ String startYear = intent.getStringExtra(Constants.PREFERENCES_KEY_SHUFFLE_START_YEAR, null);
+ if(startYear != null) {
+ editor.putString(Constants.PREFERENCES_KEY_SHUFFLE_START_YEAR, startYear);
+ }
+
+ String endYear = intent.getStringExtra(Constants.PREFERENCES_KEY_SHUFFLE_END_YEAR, null);
+ if(endYear != null) {
+ editor.putString(Constants.PREFERENCES_KEY_SHUFFLE_END_YEAR, endYear);
+ }
+
+ String genre = intent.getStringExtra(Constants.PREFERENCES_KEY_SHUFFLE_GENRE, null);
+ if(genre != null) {
+ editor.putString(Constants.PREFERENCES_KEY_SHUFFLE_GENRE, genre);
+ }
+ editor.commit();
+
downloadService.setShufflePlayEnabled(true);
} else {
downloadService.start();