Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ef70335 authored by Eric Laurent's avatar Eric Laurent Committed by Michael Bestas
Browse files

audio policy: fix capture indication to sound trigger service.

Only indicate active capture to sound trigger service
when capturing from primay HW module.

Bug: 31826453
Bug: 31771879
Change-Id: Idf92393d3e7dbf926b847ab23f670e7ab5dd5248
parent 92cc7e2b
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -2000,10 +2000,15 @@ status_t AudioPolicyManagerCustom::startInput(audio_io_handle_t input,
                    MIX_STATE_MIXING);
        }

        if (mInputs.activeInputsCountOnDevices() == 0) {
        // indicate active capture to sound trigger service if starting capture from a mic on
        // primary HW module
        audio_devices_t device = getNewInputDevice(inputDesc);
        audio_devices_t primaryInputDevices = availablePrimaryInputDevices();
        if (((device & primaryInputDevices & ~AUDIO_DEVICE_BIT_IN) != 0) &&
                mInputs.activeInputsCountOnDevices(primaryInputDevices) == 0) {
            SoundTrigger::setCaptureState(true);
        }
        setInputDevice(input, getNewInputDevice(inputDesc), true /* force */);
        setInputDevice(input, device, true /* force */);

        // automatically enable the remote submix output when input is started if not
        // used by a policy mix of type MIX_TYPE_RECORDERS