summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Chelen <michael.chelen@gmail.com>2014-09-28 22:57:54 -0400
committerMike Chelen <michael.chelen@gmail.com>2014-09-28 22:57:54 -0400
commitab59b83d21fd600388a5ef45a16e5617a1e07966 (patch)
treef2747ace139d1a04f449c9fc04f0e38ea2503ce1
parentb43037c958c53b7fcfc3e91e6a4cc06984447a39 (diff)
downloadAntennaPod-ab59b83d21fd600388a5ef45a16e5617a1e07966.zip
use persistant notification option for persistant lockscreen controls
-rw-r--r--res/values/strings.xml2
-rw-r--r--src/de/danoeh/antennapod/service/playback/PlaybackService.java17
2 files changed, 17 insertions, 2 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 451a23df8..2044a1ead 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -254,7 +254,7 @@
<string name="pref_expandNotify_title">Expand Notification</string>
<string name="pref_expandNotify_sum">Always expand the notification to show playback buttons.</string>
<string name="pref_persistNotify_title">Persistent Notification</string>
- <string name="pref_persistNotify_sum">Keep notification when playback is paused.</string>
+ <string name="pref_persistNotify_sum">Keep notification and lockscreen controls when playback is paused.</string>
<string name="pref_expand_notify_unsupport_toast">Android versions before 4.1 do not support expanded notifications.</string>
<!-- Auto-Flattr dialog -->
diff --git a/src/de/danoeh/antennapod/service/playback/PlaybackService.java b/src/de/danoeh/antennapod/service/playback/PlaybackService.java
index 49c5eca75..61a0562e6 100644
--- a/src/de/danoeh/antennapod/service/playback/PlaybackService.java
+++ b/src/de/danoeh/antennapod/service/playback/PlaybackService.java
@@ -292,7 +292,12 @@ public class PlaybackService extends Service {
case KeyEvent.KEYCODE_HEADSETHOOK:
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
if (status == PlayerStatus.PLAYING) {
- mediaPlayer.pause(true, true);
+ if (UserPreferences.isPersistNotify()) {
+ mediaPlayer.pause(false, true);
+ }
+ else {
+ mediaPlayer.pause(true, true);
+ }
} else if (status == PlayerStatus.PAUSED || status == PlayerStatus.PREPARED) {
mediaPlayer.resume();
} else if (status == PlayerStatus.PREPARING) {
@@ -312,7 +317,12 @@ public class PlaybackService extends Service {
break;
case KeyEvent.KEYCODE_MEDIA_PAUSE:
if (status == PlayerStatus.PLAYING) {
+ if (UserPreferences.isPersistNotify()) {
+ mediaPlayer.pause(false, true);
+ }
+ else {
mediaPlayer.pause(true, true);
+ }
}
break;
case KeyEvent.KEYCODE_MEDIA_NEXT:
@@ -975,7 +985,12 @@ public class PlaybackService extends Service {
*/
private void pauseIfPauseOnDisconnect() {
if (UserPreferences.isPauseOnHeadsetDisconnect()) {
+ if (UserPreferences.isPersistNotify()) {
+ mediaPlayer.pause(false, true);
+ }
+ else {
mediaPlayer.pause(true, true);
+ }
}
}