summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-11-18 09:50:35 -0800
committerMarco Nelissen <marcone@google.com>2014-11-18 09:54:54 -0800
commit707eadef2ad1388bafdb2d003a4169208fa99811 (patch)
treec5666a6e0d400df28dbd67706fbfdc742710bf8f /media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
parent35b0f7095fac4f2cc112edd4b0298a9cb1ee394f (diff)
downloadframeworks_av-707eadef2ad1388bafdb2d003a4169208fa99811.zip
frameworks_av-707eadef2ad1388bafdb2d003a4169208fa99811.tar.gz
frameworks_av-707eadef2ad1388bafdb2d003a4169208fa99811.tar.bz2
Don't autoloop notifications
Some apps think it's cool to use ringtones as notification sounds, but ringtones often loop, which is not appropriate for notifications. Bug: 15929273 Change-Id: I77c4277801cb2561743f8c676ef76ab4d1668b08
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
index b42b480..7f50a10 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
@@ -625,6 +625,16 @@ void NuPlayerDriver::notifyListener_l(
case MEDIA_PLAYBACK_COMPLETE:
{
if (mState != STATE_RESET_IN_PROGRESS) {
+ if (mAutoLoop) {
+ audio_stream_type_t streamType = AUDIO_STREAM_MUSIC;
+ if (mAudioSink != NULL) {
+ streamType = mAudioSink->getAudioStreamType();
+ }
+ if (streamType == AUDIO_STREAM_NOTIFICATION) {
+ ALOGW("disabling auto-loop for notification");
+ mAutoLoop = false;
+ }
+ }
if (mLooping || (mAutoLoop
&& (mAudioSink == NULL || mAudioSink->realtime()))) {
mPlayer->seekToAsync(0);