Acquire wake lock when playing media
This commit is contained in:
parent
5ae7371b2a
commit
df92bd98ab
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue