AudioFlinger: Add IAfPatchPanel interface

Test: atest audiorecord_tests audiotrack_tests audiorouting_tests trackplayerbase_tests audiosystem_tests
Test: atest AAudioTests AudioTrackOffloadTest
Test: atest AudioTrackTest AudioRecordTest
Test: YouTube Camera
Bug: 288339104
Bug: 291284401
Merged-In: I57b64268d95621a694d12bf347adc195570cab65
Change-Id: I57b64268d95621a694d12bf347adc195570cab65
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 31e0894..e92fd35 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -123,6 +123,7 @@
 #include "ResamplerBufferProvider.h"
 
 // include AudioFlinger component interfaces
+#include "IAfPatchPanel.h"  // this should be listed before other IAf* interfaces.
 #include "IAfEffect.h"
 #include "IAfThread.h"
 #include "IAfTrack.h"
@@ -873,7 +874,8 @@
     nsecs_t mGlobalEffectEnableTime;  // when a global effect was last enabled
 
     // protected by mLock
-    PatchPanel mPatchPanel;
+    const sp<IAfPatchPanel> mPatchPanel = IAfPatchPanel::create(this);
+
 public:
     // TODO(b/288339104) access by getter.
     sp<EffectsFactoryHalInterface> mEffectsFactoryHal;