audio policy: fix sound trigger capture disabling in startInput()
Fix test on number of active sessions in startInput()
deciding of overall capture state indication to sound trigger service.
As session active count is incremented before the test, the count indicating
the first active session is 1 and not 0.
Bug: 3289438
Test: verify OK google detection on Angler
Change-Id: I0a6c5d6240942e978fefffb536577b9d7dc29961
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 2f01b02..5ef0216 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -1754,7 +1754,7 @@
audio_devices_t primaryInputDevices = availablePrimaryInputDevices();
if (((device & primaryInputDevices & ~AUDIO_DEVICE_BIT_IN) != 0) &&
- mInputs.activeInputsCountOnDevices(primaryInputDevices) == 0) {
+ mInputs.activeInputsCountOnDevices(primaryInputDevices) == 1) {
SoundTrigger::setCaptureState(true);
}