I've been having some issues with startBluetoothSco() on my Nexus 5 on 
Android Lollipop 5.0.1, where startBluetoothSco() will work and my 
broadcast receiver will be called with an intent indicating that a 
Bluetooth mic is connected, but when a recording is started, the audio is 
recorded from the device's main input mic rather than the Bluetooth mic. 
This issue is also reproducible on the Nexus 7 and may affect other devices 
running 5.0.1 as well.

Here is some example test code:

http://pastebin.com/aEbEUhfy

Does anyone know why this is happening? The same code works fine on earlier 
versions of Android, and I can record from the Bluetooth mic there. On 
5.0.1, I still get an intent indicating that the mic is connected, but the 
device will record from the on-device mic rather than the Bluetooth mic.

The sample code requires these permissions in the manifest:

    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission 
android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />

The layout needs one button with android:id="@+id/recordStopButton".

I also opened up this bug 
report: https://code.google.com/p/android/issues/detail?id=156264

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to