summaryrefslogtreecommitdiffstats
path: root/libs/audioflinger
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-08-06 08:49:39 -0700
committerEric Laurent <elaurent@google.com>2009-08-07 10:31:53 -0700
commitd5603c126acdd94d9f7400bb1d04188020a425b4 (patch)
treed1c380e8d44bcdbe31b20e49d910b979eb222033 /libs/audioflinger
parent44495b71345b196f17552e608ac6b251c67062ff (diff)
downloadframeworks_base-d5603c126acdd94d9f7400bb1d04188020a425b4.zip
frameworks_base-d5603c126acdd94d9f7400bb1d04188020a425b4.tar.gz
frameworks_base-d5603c126acdd94d9f7400bb1d04188020a425b4.tar.bz2
AudioService now differentiates BT headsets and car kits.
The BT headset detection now makes the difference between car kits and headsets, which can be used by audio policy manager. The headset connection is also detected earlier, that is when the headset is connected and not when the SCO socket is connected as it was the case before. This allows the audio policy manager to suspend A2DP output while ringing if a SCO headset is connected.
Diffstat (limited to 'libs/audioflinger')
-rw-r--r--libs/audioflinger/AudioFlinger.cpp2
-rw-r--r--libs/audioflinger/AudioFlinger.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index fcf8a79..d019097 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -810,7 +810,7 @@ void AudioFlinger::ThreadBase::processConfigEvents()
AudioFlinger::PlaybackThread::PlaybackThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output)
: ThreadBase(audioFlinger),
- mMixBuffer(0), mSuspended(false), mBytesWritten(0), mOutput(output),
+ mMixBuffer(0), mSuspended(0), mBytesWritten(0), mOutput(output),
mLastWriteTime(0), mNumWrites(0), mNumDelayedWrites(0), mInWrite(false)
{
readOutputParameters();
diff --git a/libs/audioflinger/AudioFlinger.h b/libs/audioflinger/AudioFlinger.h
index c9f3448..4ba5977 100644
--- a/libs/audioflinger/AudioFlinger.h
+++ b/libs/audioflinger/AudioFlinger.h
@@ -502,8 +502,8 @@ private:
AudioStreamOut* getOutput() { return mOutput; }
virtual int type() const { return mType; }
- void suspend() { mSuspended = true; }
- void restore() { mSuspended = false; }
+ void suspend() { mSuspended++; }
+ void restore() { if (mSuspended) mSuspended--; }
virtual String8 getParameters(const String8& keys);
virtual void audioConfigChanged(int event, int param = 0);
@@ -520,7 +520,7 @@ private:
protected:
int mType;
int16_t* mMixBuffer;
- bool mSuspended;
+ int mSuspended;
int mBytesWritten;
bool mMasterMute;
SortedVector< wp<Track> > mActiveTracks;