diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-08-05 16:43:33 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-08-05 16:43:33 +0200 |
commit | df92bd98abe6d8a472a934a2cb9aa0ca2ede0784 (patch) | |
tree | ded5d51e8c78c4e872cdfd260781f751e1cd5ab7 /src/de | |
parent | 5ae7371b2a6f20d82a6b8cc4f7348a257dd1d54c (diff) | |
download | AntennaPod-df92bd98abe6d8a472a934a2cb9aa0ca2ede0784.zip |
Acquire wake lock when playing media
Diffstat (limited to 'src/de')
-rw-r--r-- | src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java | 2 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/util/playback/IPlayer.java | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java b/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java index 3b552c973..dd7aaee24 100644 --- a/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java +++ b/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java @@ -4,6 +4,7 @@ import android.content.ComponentName; import android.content.Context; import android.media.AudioManager; import android.media.RemoteControlClient; +import android.os.PowerManager; import android.telephony.TelephonyManager; import android.util.Log; import android.util.Pair; @@ -684,6 +685,7 @@ public class PlaybackServiceMediaPlayer { mediaPlayer = new AudioPlayer(context); } mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); + mediaPlayer.setWakeMode(context, PowerManager.PARTIAL_WAKE_LOCK); return setMediaPlayerListeners(mediaPlayer); } diff --git a/src/de/danoeh/antennapod/util/playback/IPlayer.java b/src/de/danoeh/antennapod/util/playback/IPlayer.java index 99f53fb52..2d4551b13 100644 --- a/src/de/danoeh/antennapod/util/playback/IPlayer.java +++ b/src/de/danoeh/antennapod/util/playback/IPlayer.java @@ -1,5 +1,6 @@ package de.danoeh.antennapod.util.playback; +import android.content.Context; import android.view.SurfaceHolder; import java.io.IOException; @@ -63,4 +64,6 @@ public interface IPlayer { void stop(); public void setVideoScalingMode(int mode); + + public void setWakeMode(Context context, int mode); } |