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
Loading
Please register or sign in to comment