Invalidate tracks by a list of port id.
Adding an interface to just invalidate tracks with the given list of
port id. By invalidating the tracks via given port id, it can help
prevent mmap tracks from being invalidated when a mixer policy is
registered.
Bug: 139763500
Test: manually
Test: atest audiopolicy_tests
Test: audioflinger_fuzzer
Change-Id: Ifaadb981314088e3b2ac3223accece1576a2a575
diff --git a/services/audiopolicy/AudioPolicyInterface.h b/services/audiopolicy/AudioPolicyInterface.h
index 8e0315b..520bad2 100644
--- a/services/audiopolicy/AudioPolicyInterface.h
+++ b/services/audiopolicy/AudioPolicyInterface.h
@@ -492,9 +492,6 @@
virtual status_t setStreamVolume(audio_stream_type_t stream, float volume,
audio_io_handle_t output, int delayMs = 0) = 0;
- // invalidate a stream type, causing a reroute to an unspecified new output
- virtual status_t invalidateStream(audio_stream_type_t stream) = 0;
-
// function enabling to send proprietary informations directly from audio policy manager to
// audio hardware interface.
virtual void setParameters(audio_io_handle_t ioHandle, const String8& keyValuePairs,
@@ -564,6 +561,8 @@
const TrackSecondaryOutputsMap& trackSecondaryOutputs) = 0;
virtual status_t setDeviceConnectedState(const struct audio_port_v7 *port, bool connected) = 0;
+
+ virtual status_t invalidateTracks(const std::vector<audio_port_handle_t>& portIds) = 0;
};
// These are the signatures of createAudioPolicyManager/destroyAudioPolicyManager