Audio HAL: fixes for issues discovered after client conversion

Several issues addressed:

  -- added IDevice.supportsAudioPatches to query whether
     create/removeAudioPatch is actually supported by HAL;

  -- IStreamOutCallback proxy needs to be owned by IStreamOut
     implementation. In order for the client to reset the reference,
     added method IStreamOut.clearCallback;

  -- IDevice.open{Input|Output}Stream need to return a "suggested" audio
     config from HAL;

  -- code for converting between system/audio.h and HIDL
     data structures has been moved to
     android.hardware.audio.common@2.0-util library for reuse;

  -- added a workaround for the issue with QC effects HAL trying to write
     into the input parameters buffer, which is r/o by Binder design.

Bug: 30222631
Change-Id: I64af24d79c12d6ac3b0f87d085a821913e29237b
Test: tried using with WIP HIDL client on N5X
diff --git a/audio/effect/2.0/default/Effect.h b/audio/effect/2.0/default/Effect.h
index e27a7e4..ff57051 100644
--- a/audio/effect/2.0/default/Effect.h
+++ b/audio/effect/2.0/default/Effect.h
@@ -17,6 +17,7 @@
 #ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_Effect_H_
 #define HIDL_GENERATED_android_hardware_audio_effect_V2_0_Effect_H_
 
+#include <memory>
 #include <vector>
 
 #include <android/hardware/audio/effect/2.0/IEffect.h>
@@ -180,8 +181,8 @@
     virtual ~Effect();
 
     template<typename T> static size_t alignedSizeIn(size_t s);
-    template<typename T> static void hidlVecToHal(
-            const hidl_vec<T>& vec, uint32_t* halDataSize, void** halData);
+    template<typename T> std::unique_ptr<uint8_t[]> hidlVecToHal(
+            const hidl_vec<T>& vec, uint32_t* halDataSize);
     static void effectAuxChannelsConfigFromHal(
             const channel_config_t& halConfig, EffectAuxChannelsConfig* config);
     static void effectAuxChannelsConfigToHal(