libaudiohal: Add support for audio@7.1

Added libauiohal@7.1 to support audio@7.1, core interfaces only,
no effects (these are still @7.0). Removed version-bound
namespace from the implementation to simplify code reuse. The
implementation classes are not exported from the libaudiohal
.so, thus no name conflicts could occur.

libaudiohal now tries audio@7.1 first and loads libaudiohal@7.1
client library. The library code has been updated to handle
opening of the primary device in the way appropriate for V7.1.

Note that as the effect HAL is 7.0, libaudiohal ends up loading
@7.1 client for the core HAL and @7.0 client for the effect
HAL. This can increase memory consumption.

Bug: 214426419
Test: check audio functionality on cuttlefish
      and redfin (temporarily updated to @7.1)
Change-Id: I62f72dc86dee472d6b358a9861882b9b7f6c6177
diff --git a/media/libaudiohal/impl/DeviceHalHidl.h b/media/libaudiohal/impl/DeviceHalHidl.h
index 9fd0ac0..104db40 100644
--- a/media/libaudiohal/impl/DeviceHalHidl.h
+++ b/media/libaudiohal/impl/DeviceHalHidl.h
@@ -20,15 +20,11 @@
 #include PATH(android/hardware/audio/FILE_VERSION/IDevice.h)
 #include PATH(android/hardware/audio/FILE_VERSION/IPrimaryDevice.h)
 #include <media/audiohal/DeviceHalInterface.h>
+#include <media/audiohal/EffectHalInterface.h>
 
 #include "ConversionHelperHidl.h"
 
-using ::android::hardware::audio::CPP_VERSION::IDevice;
-using ::android::hardware::audio::CPP_VERSION::IPrimaryDevice;
-using ::android::hardware::Return;
-
 namespace android {
-namespace CPP_VERSION {
 
 class DeviceHalHidl : public DeviceHalInterface, public ConversionHelperHidl
 {
@@ -140,11 +136,14 @@
 
   private:
     friend class DevicesFactoryHalHidl;
-    sp<IDevice> mDevice;
-    sp<IPrimaryDevice> mPrimaryDevice;  // Null if it's not a primary device.
+    sp<::android::hardware::audio::CPP_VERSION::IDevice> mDevice;
+    sp<::android::hardware::audio::CPP_VERSION::IPrimaryDevice> mPrimaryDevice;
+    // Null if it's not a primary device.
 
     // Can not be constructed directly by clients.
-    explicit DeviceHalHidl(const sp<IDevice>& device);
+    explicit DeviceHalHidl(const sp<::android::hardware::audio::CPP_VERSION::IDevice>& device);
+    explicit DeviceHalHidl(
+            const sp<::android::hardware::audio::CPP_VERSION::IPrimaryDevice>& device);
 
     // The destructor automatically closes the device.
     virtual ~DeviceHalHidl();
@@ -152,7 +151,6 @@
     template <typename HalPort> status_t getAudioPortImpl(HalPort *port);
 };
 
-} // namespace CPP_VERSION
 } // namespace android
 
 #endif // ANDROID_HARDWARE_DEVICE_HAL_HIDL_H