auto import from //branches/cupcake/...@137873
diff --git a/libs/audioflinger/AudioFlinger.h b/libs/audioflinger/AudioFlinger.h
index c505336..596e7f3 100644
--- a/libs/audioflinger/AudioFlinger.h
+++ b/libs/audioflinger/AudioFlinger.h
@@ -165,6 +165,7 @@
     void                    checkA2dpEnabledChange_l();
 #endif
     static bool             streamForcedToSpeaker(int streamType);
+    static bool             streamDisablesA2dp(int streamType);
     
     // Management of forced route to speaker for certain track types.
     enum force_speaker_command {
@@ -174,6 +175,9 @@
         FORCE_ROUTE_RESTORE
     };
     void                    handleForcedSpeakerRoute(int command);
+#ifdef WITH_A2DP
+    void                    handleStreamDisablesA2dp(int command);
+#endif
 
     // Internal dump utilites.
     status_t dumpPermissionDenial(int fd, const Vector<String16>& args);
@@ -576,7 +580,7 @@
     class AudioRecordThread : public Thread
     {
     public:
-        AudioRecordThread(AudioHardwareInterface* audioHardware);
+        AudioRecordThread(AudioHardwareInterface* audioHardware, const sp<AudioFlinger>& audioFlinger);
         virtual             ~AudioRecordThread();
         virtual bool        threadLoop();
         virtual status_t    readyToRun() { return NO_ERROR; }
@@ -590,6 +594,7 @@
     private:
                 AudioRecordThread();
                 AudioHardwareInterface              *mAudioHardware;
+                sp<AudioFlinger>                    mAudioFlinger;
                 sp<MixerThread::RecordTrack>        mRecordTrack;
                 Mutex                               mLock;
                 Condition                           mWaitWorkCV;
@@ -620,6 +625,10 @@
     mutable     int                                 mHardwareStatus;
                 SortedVector< wp<IBinder> >         mNotificationClients;
                 int                                 mForcedSpeakerCount;
+                int                                 mA2dpDisableCount;
+
+                // true if A2DP should resume when mA2dpDisableCount returns to zero
+                bool                                mA2dpSuppressed;
                 uint32_t                            mSavedRoute;
                 uint32_t                            mForcedRoute;
                 nsecs_t                             mRouteRestoreTime;