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

AudioDeviceInventory: fix devices role cache purge.

Purging the devices role cache when a device is disconnected should be
handled differently whether the role request comes from an API or whether
it has been created internally. Requests coming from an API must not be
cancelled when the device is disconnected, whereas internal requests
must.
Created separate caches for internal and API requests.
Also fix a problem in AudioDeviceInventory.purgeRoles() where we cannot
rely on the connected device list (mConnectedDevices) because it does not
contain attached devices like a speaker.

Bug: 284468571
Test: repro steps in bug
Test: atest NonDefaultDeviceForStrategyTest
Test: atest AudioManagerTest#testPreferredDevicesForStrategy
Test: atest AudioManagerTest#testPreferredDeviceForCapturePreset

Change-Id: I04d620b7c494ce3275baa001fa6f6ed04857e889
parent 6daf38c0
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