Loading services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h +0 −2 Original line number Original line Diff line number Diff line Loading @@ -84,8 +84,6 @@ public: audio_devices_t getDevicesFromHwModule(audio_module_handle_t moduleHandle) const; audio_devices_t getDevicesFromHwModule(audio_module_handle_t moduleHandle) const; audio_policy_dev_state_t getDeviceConnectionState(const sp<DeviceDescriptor> &devDesc) const; status_t dump(int fd, const String8 &tag, int spaces = 0, bool verbose = true) const; status_t dump(int fd, const String8 &tag, int spaces = 0, bool verbose = true) const; private: private: Loading services/audiopolicy/common/managerdefinitions/include/HwModule.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -106,7 +106,8 @@ public: sp<DeviceDescriptor> getDeviceDescriptor(const audio_devices_t device, sp<DeviceDescriptor> getDeviceDescriptor(const audio_devices_t device, const char *device_address, const char *device_address, const char *device_name) const; const char *device_name, bool matchAdress = true) const; status_t dump(int fd) const; status_t dump(int fd) const; }; }; Loading services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp +0 −6 Original line number Original line Diff line number Diff line Loading @@ -219,12 +219,6 @@ status_t DeviceVector::dump(int fd, const String8 &tag, int spaces, bool verbose return NO_ERROR; return NO_ERROR; } } audio_policy_dev_state_t DeviceVector::getDeviceConnectionState(const sp<DeviceDescriptor> &devDesc) const { ssize_t index = indexOf(devDesc); return index >= 0 ? AUDIO_POLICY_DEVICE_STATE_AVAILABLE : AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE; } void DeviceDescriptor::toAudioPortConfig(struct audio_port_config *dstConfig, void DeviceDescriptor::toAudioPortConfig(struct audio_port_config *dstConfig, const struct audio_port_config *srcConfig) const const struct audio_port_config *srcConfig) const { { Loading services/audiopolicy/common/managerdefinitions/src/HwModule.cpp +10 −3 Original line number Original line Diff line number Diff line Loading @@ -292,7 +292,8 @@ sp <HwModule> HwModuleCollection::getModuleForDevice(audio_devices_t device) con sp<DeviceDescriptor> HwModuleCollection::getDeviceDescriptor(const audio_devices_t device, sp<DeviceDescriptor> HwModuleCollection::getDeviceDescriptor(const audio_devices_t device, const char *device_address, const char *device_address, const char *device_name) const const char *device_name, bool matchAdress) const { { String8 address = (device_address == NULL) ? String8("") : String8(device_address); String8 address = (device_address == NULL) ? String8("") : String8(device_address); // handle legacy remote submix case where the address was not always specified // handle legacy remote submix case where the address was not always specified Loading @@ -305,11 +306,17 @@ sp<DeviceDescriptor> HwModuleCollection::getDeviceDescriptor(const audio_device if (hwModule->mHandle == 0) { if (hwModule->mHandle == 0) { continue; continue; } } DeviceVector deviceList = DeviceVector declaredDevices = hwModule->getDeclaredDevices(); hwModule->getDeclaredDevices().getDevicesFromTypeAddr(device, address); DeviceVector deviceList = declaredDevices.getDevicesFromTypeAddr(device, address); if (!deviceList.isEmpty()) { if (!deviceList.isEmpty()) { return deviceList.itemAt(0); return deviceList.itemAt(0); } } if (!matchAdress) { deviceList = declaredDevices.getDevicesFromType(device); if (!deviceList.isEmpty()) { return deviceList.itemAt(0); } } } } sp<DeviceDescriptor> devDesc = new DeviceDescriptor(device); sp<DeviceDescriptor> devDesc = new DeviceDescriptor(device); Loading services/audiopolicy/managerdefault/AudioPolicyManager.cpp +12 −2 Original line number Original line Diff line number Diff line Loading @@ -291,7 +291,15 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device, audio_policy_dev_state_t AudioPolicyManager::getDeviceConnectionState(audio_devices_t device, audio_policy_dev_state_t AudioPolicyManager::getDeviceConnectionState(audio_devices_t device, const char *device_address) const char *device_address) { { sp<DeviceDescriptor> devDesc = mHwModules.getDeviceDescriptor(device, device_address, ""); sp<DeviceDescriptor> devDesc = mHwModules.getDeviceDescriptor(device, device_address, "", (strlen(device_address) != 0)/*matchAddress*/); if (devDesc == 0) { ALOGW("getDeviceConnectionState() undeclared device, type %08x, address: %s", device, device_address); return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE; } DeviceVector *deviceVector; DeviceVector *deviceVector; Loading @@ -303,7 +311,9 @@ audio_policy_dev_state_t AudioPolicyManager::getDeviceConnectionState(audio_devi ALOGW("getDeviceConnectionState() invalid device type %08x", device); ALOGW("getDeviceConnectionState() invalid device type %08x", device); return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE; return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE; } } return deviceVector->getDeviceConnectionState(devDesc); return (deviceVector->getDevice(device, String8(device_address)) != 0) ? AUDIO_POLICY_DEVICE_STATE_AVAILABLE : AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE; } } void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs) void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs) Loading Loading
services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h +0 −2 Original line number Original line Diff line number Diff line Loading @@ -84,8 +84,6 @@ public: audio_devices_t getDevicesFromHwModule(audio_module_handle_t moduleHandle) const; audio_devices_t getDevicesFromHwModule(audio_module_handle_t moduleHandle) const; audio_policy_dev_state_t getDeviceConnectionState(const sp<DeviceDescriptor> &devDesc) const; status_t dump(int fd, const String8 &tag, int spaces = 0, bool verbose = true) const; status_t dump(int fd, const String8 &tag, int spaces = 0, bool verbose = true) const; private: private: Loading
services/audiopolicy/common/managerdefinitions/include/HwModule.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -106,7 +106,8 @@ public: sp<DeviceDescriptor> getDeviceDescriptor(const audio_devices_t device, sp<DeviceDescriptor> getDeviceDescriptor(const audio_devices_t device, const char *device_address, const char *device_address, const char *device_name) const; const char *device_name, bool matchAdress = true) const; status_t dump(int fd) const; status_t dump(int fd) const; }; }; Loading
services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp +0 −6 Original line number Original line Diff line number Diff line Loading @@ -219,12 +219,6 @@ status_t DeviceVector::dump(int fd, const String8 &tag, int spaces, bool verbose return NO_ERROR; return NO_ERROR; } } audio_policy_dev_state_t DeviceVector::getDeviceConnectionState(const sp<DeviceDescriptor> &devDesc) const { ssize_t index = indexOf(devDesc); return index >= 0 ? AUDIO_POLICY_DEVICE_STATE_AVAILABLE : AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE; } void DeviceDescriptor::toAudioPortConfig(struct audio_port_config *dstConfig, void DeviceDescriptor::toAudioPortConfig(struct audio_port_config *dstConfig, const struct audio_port_config *srcConfig) const const struct audio_port_config *srcConfig) const { { Loading
services/audiopolicy/common/managerdefinitions/src/HwModule.cpp +10 −3 Original line number Original line Diff line number Diff line Loading @@ -292,7 +292,8 @@ sp <HwModule> HwModuleCollection::getModuleForDevice(audio_devices_t device) con sp<DeviceDescriptor> HwModuleCollection::getDeviceDescriptor(const audio_devices_t device, sp<DeviceDescriptor> HwModuleCollection::getDeviceDescriptor(const audio_devices_t device, const char *device_address, const char *device_address, const char *device_name) const const char *device_name, bool matchAdress) const { { String8 address = (device_address == NULL) ? String8("") : String8(device_address); String8 address = (device_address == NULL) ? String8("") : String8(device_address); // handle legacy remote submix case where the address was not always specified // handle legacy remote submix case where the address was not always specified Loading @@ -305,11 +306,17 @@ sp<DeviceDescriptor> HwModuleCollection::getDeviceDescriptor(const audio_device if (hwModule->mHandle == 0) { if (hwModule->mHandle == 0) { continue; continue; } } DeviceVector deviceList = DeviceVector declaredDevices = hwModule->getDeclaredDevices(); hwModule->getDeclaredDevices().getDevicesFromTypeAddr(device, address); DeviceVector deviceList = declaredDevices.getDevicesFromTypeAddr(device, address); if (!deviceList.isEmpty()) { if (!deviceList.isEmpty()) { return deviceList.itemAt(0); return deviceList.itemAt(0); } } if (!matchAdress) { deviceList = declaredDevices.getDevicesFromType(device); if (!deviceList.isEmpty()) { return deviceList.itemAt(0); } } } } sp<DeviceDescriptor> devDesc = new DeviceDescriptor(device); sp<DeviceDescriptor> devDesc = new DeviceDescriptor(device); Loading
services/audiopolicy/managerdefault/AudioPolicyManager.cpp +12 −2 Original line number Original line Diff line number Diff line Loading @@ -291,7 +291,15 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device, audio_policy_dev_state_t AudioPolicyManager::getDeviceConnectionState(audio_devices_t device, audio_policy_dev_state_t AudioPolicyManager::getDeviceConnectionState(audio_devices_t device, const char *device_address) const char *device_address) { { sp<DeviceDescriptor> devDesc = mHwModules.getDeviceDescriptor(device, device_address, ""); sp<DeviceDescriptor> devDesc = mHwModules.getDeviceDescriptor(device, device_address, "", (strlen(device_address) != 0)/*matchAddress*/); if (devDesc == 0) { ALOGW("getDeviceConnectionState() undeclared device, type %08x, address: %s", device, device_address); return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE; } DeviceVector *deviceVector; DeviceVector *deviceVector; Loading @@ -303,7 +311,9 @@ audio_policy_dev_state_t AudioPolicyManager::getDeviceConnectionState(audio_devi ALOGW("getDeviceConnectionState() invalid device type %08x", device); ALOGW("getDeviceConnectionState() invalid device type %08x", device); return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE; return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE; } } return deviceVector->getDeviceConnectionState(devDesc); return (deviceVector->getDevice(device, String8(device_address)) != 0) ? AUDIO_POLICY_DEVICE_STATE_AVAILABLE : AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE; } } void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs) void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs) Loading