audio: Add a helper class to simplify legacy HALs migration

Since in the C and HIDL APIs the method for opening a stream
receives the device to connect to, some legacy HAL implementations
took an advantage of that. In AIDL APIs device port connection
process is more dynamic and independent of the stream creation.

To simplify porting of legacy implementations to AIDL, a helper
class StreamSwitcher is added. It emulates the legacy behavior
by allowing to postpone the stream implementation creation until
the connected device is known. Until that moment, it exposes
to the client a stub implementation of the stream interface.

Bug: 264712385
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ie8ae0338fd22f705e00a34e56a7fa235eda5ed9e
diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp
index 19b2397..4e583a4 100644
--- a/audio/aidl/default/Android.bp
+++ b/audio/aidl/default/Android.bp
@@ -76,6 +76,7 @@
         "ModulePrimary.cpp",
         "SoundDose.cpp",
         "Stream.cpp",
+        "StreamSwitcher.cpp",
         "Telephony.cpp",
         "alsa/Mixer.cpp",
         "alsa/ModuleAlsa.cpp",