libaudiohal: Implement retrieval of APM configuration

Add the following interface methods:
 - DevicesFactoryHalInterface::getDeviceNames
 - DevicesFactoryHalInterface::getSurroundSoundConfig
 - DevicesFactoryHalInterface::getEngineConfig
 - DeviceHalInterface::getAudioPorts
 - DeviceHalInterface::getAudioRoutes

These methods are implemented for the AIDL adapter.
The HIDL adapter does not implement them, and this is
how the framework will know that it needs to fall back
to use the XML config.

Bug: 205884982
Test: m
(cherry picked from https://android-review.googlesource.com/q/commit:f83b974f39b7e8ba61d201014d781eccd4c8b09a)
Merged-In: Iaab5dfa00587b5db6c9cb472dcec6a8e3f6417e0
Change-Id: Iaab5dfa00587b5db6c9cb472dcec6a8e3f6417e0
diff --git a/media/libaudiohal/impl/DeviceHalAidl.h b/media/libaudiohal/impl/DeviceHalAidl.h
index a336043..b2bba1f 100644
--- a/media/libaudiohal/impl/DeviceHalAidl.h
+++ b/media/libaudiohal/impl/DeviceHalAidl.h
@@ -69,6 +69,10 @@
 class DeviceHalAidl : public DeviceHalInterface, public ConversionHelperAidl,
                       public CallbackBroker, public MicrophoneInfoProvider {
   public:
+    status_t getAudioPorts(std::vector<media::audio::common::AudioPort> *ports) override;
+
+    status_t getAudioRoutes(std::vector<media::AudioRoute> *routes) override;
+
     // Sets the value of 'devices' to a bitmask of 1 or more values of audio_devices_t.
     status_t getSupportedDevices(uint32_t *devices) override;
 
@@ -185,6 +189,7 @@
     using PortConfigs = std::map<int32_t /*port config ID*/,
             ::aidl::android::media::audio::common::AudioPortConfig>;
     using Ports = std::map<int32_t /*port ID*/, ::aidl::android::media::audio::common::AudioPort>;
+    using Routes = std::vector<::aidl::android::hardware::audio::core::AudioRoute>;
     // Answers the question "whether portID 'first' is reachable from portID 'second'?"
     // It's not a map because both portIDs are known. The matrix is symmetric.
     using RoutingMatrix = std::set<std::pair<int32_t, int32_t>>;
@@ -287,6 +292,7 @@
     PortConfigs mPortConfigs;
     std::set<int32_t> mInitialPortConfigIds;
     Patches mPatches;
+    Routes mRoutes;
     RoutingMatrix mRoutingMatrix;
     Streams mStreams;
     Microphones mMicrophones;