diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2019-06-24 10:39:19 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2019-08-01 08:10:18 -0700 |
commit | dc552e9d88ca8e65baede28f33497a5dfd013185 (patch) | |
tree | b210992f94b7dd18445b45226d0918aae6fdc04c /libs/hwui/service/GraphicsStatsService.cpp | |
parent | e768ca13d6eb74300b576bbf63309a8e28b48654 (diff) |
AudioService: fix disconnect/connect of A2DP device
Due to the expected BECOMING_NOISY behavior associated
with a device disconnection, the disconnection is handled
asynchronously after a fixed delay. This delay caused an
inversion of commands in the processing order of the
disconnection of a device closely followed by connection
of the same device.
The fix consists in:
- overriding the equals() operator for BtDeviceConnectionInfo
so messages for a given device in the message queue
can be checked / removed.
- when AudioDeviceBroker receives a command for A2DP
connection or disconnection, remove all upcoming connection
and disconnection commands in the queue for this device
(see postBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent)
- remove AudioDeviceBroker.handleSetA2dpSinkConnectionState, which
was only used in BtHelper.onA2dpProfileConnected() with
a CONNECTED state, and have this method perform a regular device
connection (just like when coming from AM->AS).
- in AudioDeviceInventory.onSetA2dpSinkConnectionState(), support
receiving a connection event for an already connected device,
to support codec changes.
This change also includes modifications to the classes involved
in the device connection to make them support mocking/spying
to reproduce the bug conditions (see AudioDeviceBrokerTest).
Bug: 134932649
Test: atest AudioDeviceBrokerTest
Change-Id: If2b3b41409c77467a181a2f9b42310db9b9de8c5
Diffstat (limited to 'libs/hwui/service/GraphicsStatsService.cpp')
0 files changed, 0 insertions, 0 deletions