Skip to content
Commit b79ef23e authored by Eric Laurent's avatar Eric Laurent
Browse files

AudioDeviceBroker: fix speakerphone state reporting

Send ACTION_SPEAKERPHONE_STATE_CHANGED only when the speakerphone
is actually turned ON/OFF instead of when requested ON/OFF.

Make sure we update the active communication device after the message
requesting the preferred phone strategy device is processed: when no
device is preferred, the actual active device is read back from audio
policy manager.

Also:
- Factored in and use consistent naming for methods dealing with communication
device selection
- Use cached SCO ON state for volume related decisions to avoid lock
contention

Bug: 171177848
Test: AudioManagerTest.testRouting AudioManagerTest.testSpeakerphoneIntent
Test: AudioCommunicationDeviceTest
Change-Id: Ic5e84a1f85f0fa5dac2abed34fc85a58f41e4816
parent b6521e0a
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