Skip to content
Commit 1d188440 authored by Sharad Sangle's avatar Sharad Sangle Committed by jiabin
Browse files

AudioService: Don't honour SCO ON request if SCO is not connected

Usecase:
1. Pair and connect BT headset supporting HFP.
2. Make VOIP calls using application that calls
   setBluetoothScoOn(true) before SCO is actually connected.

Failure:
No audio / ANR are observed on connecting and disconnecting BT headset
during VOIP call.

Rootcause:
On BT connection during VOIP call, app is calling startBluetoothSco()
to setup BT SCO connection. Even before remote BT device SCO connection
establishment(which is taking around 4 secs in issue case), VOIP app
is calling force SCO routing using setBluetoothScoOn() API. This will
result audio modules to force route VOIP call to BT SCO, which results
audio failure/side effects as BT driver return failures. As SCO routing
retry continues several iterations (because of connection delays), this
results ADSP render buffer full followed by improper behavior.

Fix:
Check if SCO connection is establisted before honouring the
setBluetoothScoOn request, if SCO is not connected then
do not process SCO connection.
Only modify internal state when calls to setBluetoothScoOn() are from
system component
Inform audio HAL of SCO audio state via setParameters.

Test: 1. Pair and connect BT headset supporting HFP
      2. Make VOIP calls using application that calls
         setBluetoothScoOn(true) before SCO is actually connected.

Bug: 62051216
Bug: 63740200
Change-Id: Iab8e83613e21831abf5502a0268b1c4f89d6bba5
parent 56e5c394
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment