Loading services/audiopolicy/managerdefault/Devices.cpp +6 −2 Original line number Original line Diff line number Diff line Loading @@ -180,10 +180,14 @@ sp<DeviceDescriptor> DeviceVector::getDeviceFromId(audio_port_handle_t id) const DeviceVector DeviceVector::getDevicesFromType(audio_devices_t type) const DeviceVector DeviceVector::getDevicesFromType(audio_devices_t type) const { { DeviceVector devices; DeviceVector devices; bool isOutput = audio_is_output_devices(type); type &= ~AUDIO_DEVICE_BIT_IN; for (size_t i = 0; (i < size()) && (type != AUDIO_DEVICE_NONE); i++) { for (size_t i = 0; (i < size()) && (type != AUDIO_DEVICE_NONE); i++) { if (itemAt(i)->mDeviceType & type & ~AUDIO_DEVICE_BIT_IN) { bool curIsOutput = audio_is_output_devices(itemAt(i)->mDeviceType); audio_devices_t curType = itemAt(i)->mDeviceType & ~AUDIO_DEVICE_BIT_IN; if ((isOutput == curIsOutput) && ((type & curType) != 0)) { devices.add(itemAt(i)); devices.add(itemAt(i)); type &= ~itemAt(i)->mDeviceType; type &= ~curType; ALOGV("DeviceVector::getDevicesFromType() for type %x found %p", ALOGV("DeviceVector::getDevicesFromType() for type %x found %p", itemAt(i)->mDeviceType, itemAt(i).get()); itemAt(i)->mDeviceType, itemAt(i).get()); } } Loading Loading
services/audiopolicy/managerdefault/Devices.cpp +6 −2 Original line number Original line Diff line number Diff line Loading @@ -180,10 +180,14 @@ sp<DeviceDescriptor> DeviceVector::getDeviceFromId(audio_port_handle_t id) const DeviceVector DeviceVector::getDevicesFromType(audio_devices_t type) const DeviceVector DeviceVector::getDevicesFromType(audio_devices_t type) const { { DeviceVector devices; DeviceVector devices; bool isOutput = audio_is_output_devices(type); type &= ~AUDIO_DEVICE_BIT_IN; for (size_t i = 0; (i < size()) && (type != AUDIO_DEVICE_NONE); i++) { for (size_t i = 0; (i < size()) && (type != AUDIO_DEVICE_NONE); i++) { if (itemAt(i)->mDeviceType & type & ~AUDIO_DEVICE_BIT_IN) { bool curIsOutput = audio_is_output_devices(itemAt(i)->mDeviceType); audio_devices_t curType = itemAt(i)->mDeviceType & ~AUDIO_DEVICE_BIT_IN; if ((isOutput == curIsOutput) && ((type & curType) != 0)) { devices.add(itemAt(i)); devices.add(itemAt(i)); type &= ~itemAt(i)->mDeviceType; type &= ~curType; ALOGV("DeviceVector::getDevicesFromType() for type %x found %p", ALOGV("DeviceVector::getDevicesFromType() for type %x found %p", itemAt(i)->mDeviceType, itemAt(i).get()); itemAt(i)->mDeviceType, itemAt(i).get()); } } Loading