Clear input routing when closeAllInputs().

When the device disconnect, all inputs will be closed before calling
releaseInput(). In that case, input route ref count will be wrong due to
route couldn't be removed in releaseInput() since the input is already
closed, that may cause the routing error. Clear input routes to prevent
the routing error when closing all inputs.

Bug: 77520691
Test: Reconnecting the usb device, check the input routing.
Change-Id: I754cf2774c9c38b751f918b32e881b6d464a7a01
gugelfrei
jiabin 6 years ago
parent 93768b1382
commit 829a00bd6e

@ -2141,6 +2141,7 @@ void AudioPolicyManager::closeAllInputs() {
}
inputDesc->close();
}
mInputRoutes.clear();
mInputs.clear();
SoundTrigger::setCaptureState(false);
nextAudioPortGeneration();

Loading…
Cancel
Save