Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 708e038f authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

audiopolicy: Brush up DeviceVector::getDevice... methods

The semantics of these methods wasn't consistent and wasn't clear
from their names (and aggravated by the fact that audio_devices_t can
be used either as a single device, or as a mask):

 * sp<DeviceDescriptor> getDevice(type, address) -- 'type' is a single
   device; if 'address' is an empty string, and no matching device
   with an empty address is found, returns any device of this type;

 * DeviceVector getDevicesFromType(type) -- 'type' is a mask,
   device addresses get ignored;

 * DeviceVector getDevicesFromTypeAddr(type, address) -- 'type' is
   a single device, address is matched exactly. So in practice, only
   1 device could be returned.

Changes:

 * 'getDevicesFromType' renamed to 'getDevicesFromTypeMask' --
   emhpasizes the fact that 'type' can be a mask;

 * 'getDevicesFromTypeAddr' removed, usages replaced with a call to
   'getDevice'. There were just 2 usages, and their intent seem
   to be covered by the semantics of 'getDevice'.

Test: verified basic audio functionality and Auto with simulator
Change-Id: If3e42e4c06f42573fd33ba1303febe0625e079e6
parent f4d3741b
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