AI 144151: am: CL 144150 Fix heap corruption.
  Take mutex in close(), and skip write path after turning bluetooth off.
  Original author: npelly
  Merged from: //branches/cupcake/...

Automated import of CL 144151
diff --git a/libs/audioflinger/A2dpAudioInterface.h b/libs/audioflinger/A2dpAudioInterface.h
index 99614dc..7901a8c 100644
--- a/libs/audioflinger/A2dpAudioInterface.h
+++ b/libs/audioflinger/A2dpAudioInterface.h
@@ -88,7 +88,9 @@
         friend class A2dpAudioInterface;
                 status_t    init();
                 status_t    close();
-        status_t            setAddress(const char* address);
+                status_t    close_l();
+                status_t    setAddress(const char* address);
+                status_t    setBluetoothEnabled(bool enabled);
 
     private:
                 int         mFd;
@@ -98,6 +100,7 @@
                 char        mA2dpAddress[20];
                 void*       mData;
                 Mutex       mLock;
+                bool        mBluetoothEnabled;
     };
 
     A2dpAudioStreamOut*     mOutput;