Loading services/audiopolicy/managerdefault/AudioPolicyManager.cpp +16 −5 Original line number Diff line number Diff line Loading @@ -2247,9 +2247,15 @@ status_t AudioPolicyManager::startInput(audio_port_handle_t portId) // indicate active capture to sound trigger service if starting capture from a mic on // primary HW module sp<DeviceDescriptor> device = getNewInputDevice(inputDesc); setInputDevice(input, device, true /* force */); if (device != nullptr) { status = setInputDevice(input, device, true /* force */); } else { ALOGW("%s no new input device can be found for descriptor %d", __FUNCTION__, inputDesc->getId()); status = BAD_VALUE; } if (inputDesc->activeCount() == 1) { if (status == NO_ERROR && inputDesc->activeCount() == 1) { sp<AudioPolicyMix> policyMix = inputDesc->mPolicyMix.promote(); // if input maps to a dynamic policy with an activity listener, notify of state change if ((policyMix != NULL) Loading Loading @@ -2280,11 +2286,16 @@ status_t AudioPolicyManager::startInput(audio_port_handle_t portId) address, "remote-submix", AUDIO_FORMAT_DEFAULT); } } } else if (status != NO_ERROR) { // Restore client activity state. inputDesc->setClientActive(client, false); inputDesc->stop(); } ALOGV("%s input %d source = %d exit", __FUNCTION__, input, client->source()); ALOGV("%s input %d source = %d status = %d exit", __FUNCTION__, input, client->source(), status); return NO_ERROR; return status; } status_t AudioPolicyManager::stopInput(audio_port_handle_t portId) Loading Loading
services/audiopolicy/managerdefault/AudioPolicyManager.cpp +16 −5 Original line number Diff line number Diff line Loading @@ -2247,9 +2247,15 @@ status_t AudioPolicyManager::startInput(audio_port_handle_t portId) // indicate active capture to sound trigger service if starting capture from a mic on // primary HW module sp<DeviceDescriptor> device = getNewInputDevice(inputDesc); setInputDevice(input, device, true /* force */); if (device != nullptr) { status = setInputDevice(input, device, true /* force */); } else { ALOGW("%s no new input device can be found for descriptor %d", __FUNCTION__, inputDesc->getId()); status = BAD_VALUE; } if (inputDesc->activeCount() == 1) { if (status == NO_ERROR && inputDesc->activeCount() == 1) { sp<AudioPolicyMix> policyMix = inputDesc->mPolicyMix.promote(); // if input maps to a dynamic policy with an activity listener, notify of state change if ((policyMix != NULL) Loading Loading @@ -2280,11 +2286,16 @@ status_t AudioPolicyManager::startInput(audio_port_handle_t portId) address, "remote-submix", AUDIO_FORMAT_DEFAULT); } } } else if (status != NO_ERROR) { // Restore client activity state. inputDesc->setClientActive(client, false); inputDesc->stop(); } ALOGV("%s input %d source = %d exit", __FUNCTION__, input, client->source()); ALOGV("%s input %d source = %d status = %d exit", __FUNCTION__, input, client->source(), status); return NO_ERROR; return status; } status_t AudioPolicyManager::stopInput(audio_port_handle_t portId) Loading