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
Change-Id: I57b64268d95621a694d12bf347adc195570cab65
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 7067c83..a062ac6 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -124,6 +124,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"
@@ -879,7 +880,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;