audio flinger: fix fuzz test crash
Clear output stream pointer in duplicating thread
when the main output to which it is attached is closed.
Also do not forward master mute and volume commands to
duplicating threads as this is not applicable.
Also fix logic in AudioFlinger::primaryPlaybackThread_l()
that could accidentally return a duplicating thread.
This never happens because the primary thread is always
first in the list.
Bug: 20731946.
Change-Id: Ic8869699836920351b23d09544c50a258d3fb585
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index 0a5597f..37bacae 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -230,6 +230,8 @@
// static externally-visible
type_t type() const { return mType; }
+ bool isDuplicating() const { return (mType == DUPLICATING); }
+
audio_io_handle_t id() const { return mId;}
// dynamic externally-visible