title: Recording bluetooth headset audio in Nougat
body: <p>So, I'm trying to record a wave file from and Bluetooth Headset.</p>
  
  <p>This is what I use to record</p>
  
  <pre><code> recorder = AudioRecord(MediaRecorder.AudioSource.VOICE_COMMUNICATION,
                  8000,
                  AudioFormat.CHANNEL_IN_MONO,
                  AudioFormat.ENCODING_PCM_16BIT,
                  BUFFER_SIZE)
  </code></pre>
  
  <p>And before starting recording I'm beginning and audio communication with my headset using</p>
  
  <pre><code>var am = getSystemService(Context.AUDIO_SERVICE) as AudioManager
  am!!.mode = 0
  am!!.isBluetoothScoOn = true
  am!!.startBluetoothSco()
  am!!.mode = AudioManager.MODE_IN_COMMUNICATION
  </code></pre>
  
  <p>Well, it works wonders when recording in Android 6 (marshmallow), but when recording in Android 7 (nougat), it keeps recording from my phone's microphone and not the Bluetooth headset. Looking in the documentation, I didn't find anything regarding changes in Bluetooth SCO between versions. So.... what am I missing? </p>