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

Commit 0264e7d6 authored by Andy Hung's avatar Andy Hung
Browse files

AudioFlinger: Preserve recent RecordThread history for dumpsys

Test: audioflinger dumpsys after record
Bug: 115946219
Change-Id: Ic551ae38a35acc3ed21eee5da3b42d6b07454899
parent 45146a2c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2549,6 +2549,16 @@ status_t AudioFlinger::closeInput_nonvirtual(audio_io_handle_t input)
        if (recordThread != 0) {
            ALOGV("closeInput() %d", input);

            {
                // Dump thread before deleting for history
                audio_utils::FdToString fdToString;
                const int fd = fdToString.fd();
                if (fd >= 0) {
                    recordThread->dump(fd, {} /* args */);
                    mThreadLog.logs(-1 /* time */, fdToString.getStringAndClose());
                }
            }

            // If we still have effect chains, it means that a client still holds a handle
            // on at least one effect. We must either move the chain to an existing thread with the
            // same session ID or put it aside in case a new record thread is opened for a