AudioFlinger: Extract inner VolumeInterface class

Change to RefBase for proper lifetime as the sibling
interfaces are also refcounted.

Test: atest audiorecord_tests audiotrack_tests audiorouting_tests trackplayerbase_tests audiosystem_tests
Test: atest AudioTrackTest AudioRecordTest
Test: YouTube Camera
Bug: 288339104
Bug: 290288893
Merged-In: I92ad5ce31152813e935cb3e549bde3d11241ef64
Change-Id: I92ad5ce31152813e935cb3e549bde3d11241ef64
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 6c59df0..3fcf693 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -102,6 +102,7 @@
 #include <datapath/SpdifStreamOut.h>
 #include <datapath/ThreadMetrics.h>
 #include <datapath/TrackMetrics.h>
+#include <datapath/VolumeInterface.h>
 #include <fastpath/FastCapture.h>
 #include <fastpath/FastMixer.h>
 #include <media/nbaio/NBAIO.h>
@@ -654,8 +655,8 @@
               MixerThread *checkMixerThread_l(audio_io_handle_t output) const;
               RecordThread *checkRecordThread_l(audio_io_handle_t input) const;
               MmapThread *checkMmapThread_l(audio_io_handle_t io) const;
-              VolumeInterface *getVolumeInterface_l(audio_io_handle_t output) const;
-              Vector <VolumeInterface *> getAllVolumeInterfaces_l() const;
+              sp<VolumeInterface> getVolumeInterface_l(audio_io_handle_t output) const;
+              std::vector<sp<VolumeInterface>> getAllVolumeInterfaces_l() const;
 
               sp<ThreadBase> openInput_l(audio_module_handle_t module,
                                            audio_io_handle_t *input,