Define HAL for audio effects

Created after hardware/audio_effect.h with the following changes:

 - names changed to satisfy HAL style guide;

 - defined an interface per effect, an interface method
   per command, and getter / setter methods for properties;

 - retained methods for executing proprietary commands
   and accessing proprietary properties, only to be used
   for third-party software effects;

 - HIDL vector type is used instead of count / array pairs;

 - provider callback changed to be used over RPC;

 - 'dump' is method is already defined by generated code.

Note that audio data is currently transferred using AudioBuffers,
which is not effective due to memory copy and HwBinder transaction
involved. The transfer method will be changed to FastMessageQueue.

Bug: 30222631
Test: make
Change-Id: Ic8ea5c19688610ebe642c7597d2bcfa3226977e7
diff --git a/audio/effect/2.0/Android.bp b/audio/effect/2.0/Android.bp
new file mode 100644
index 0000000..4dd2b1e
--- /dev/null
+++ b/audio/effect/2.0/Android.bp
@@ -0,0 +1,151 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+    name: "android.hardware.audio.effect@2.0_genc++",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.audio.effect@2.0",
+    srcs: [
+        "types.hal",
+        "IAcousticEchoCancelerEffect.hal",
+        "IAutomaticGainControlEffect.hal",
+        "IBassBoostEffect.hal",
+        "IDownmixEffect.hal",
+        "IEffect.hal",
+        "IEffectBufferProviderCallback.hal",
+        "IEffectsFactory.hal",
+        "IEnvironmentalReverbEffect.hal",
+        "IEqualizerEffect.hal",
+        "ILoudnessEnhancerEffect.hal",
+        "INoiseSuppressionEffect.hal",
+        "IPresetReverbEffect.hal",
+        "IVirtualizerEffect.hal",
+        "IVisualizerEffect.hal",
+    ],
+    out: [
+        "android/hardware/audio/effect/2.0/types.cpp",
+        "android/hardware/audio/effect/2.0/AcousticEchoCancelerEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/AutomaticGainControlEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/BassBoostEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/DownmixEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/EffectAll.cpp",
+        "android/hardware/audio/effect/2.0/EffectBufferProviderCallbackAll.cpp",
+        "android/hardware/audio/effect/2.0/EffectsFactoryAll.cpp",
+        "android/hardware/audio/effect/2.0/EnvironmentalReverbEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/EqualizerEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/LoudnessEnhancerEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/NoiseSuppressionEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/PresetReverbEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/VirtualizerEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/VisualizerEffectAll.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.audio.effect@2.0_genc++_headers",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.audio.effect@2.0",
+    srcs: [
+        "types.hal",
+        "IAcousticEchoCancelerEffect.hal",
+        "IAutomaticGainControlEffect.hal",
+        "IBassBoostEffect.hal",
+        "IDownmixEffect.hal",
+        "IEffect.hal",
+        "IEffectBufferProviderCallback.hal",
+        "IEffectsFactory.hal",
+        "IEnvironmentalReverbEffect.hal",
+        "IEqualizerEffect.hal",
+        "ILoudnessEnhancerEffect.hal",
+        "INoiseSuppressionEffect.hal",
+        "IPresetReverbEffect.hal",
+        "IVirtualizerEffect.hal",
+        "IVisualizerEffect.hal",
+    ],
+    out: [
+        "android/hardware/audio/effect/2.0/types.h",
+        "android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/IHwAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/BnAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/BpAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/BsAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/IAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/IHwAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/BnAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/BpAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/BsAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/IBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/IHwBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/BnBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/BpBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/BsBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/IDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/IHwDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/BnDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/BpDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/BsDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/IEffect.h",
+        "android/hardware/audio/effect/2.0/IHwEffect.h",
+        "android/hardware/audio/effect/2.0/BnEffect.h",
+        "android/hardware/audio/effect/2.0/BpEffect.h",
+        "android/hardware/audio/effect/2.0/BsEffect.h",
+        "android/hardware/audio/effect/2.0/IEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/IHwEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/BnEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/BpEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/BsEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/IEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/IHwEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/BnEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/BpEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/BsEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/IEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/IHwEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BnEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BpEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BsEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/IEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/IHwEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BnEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BpEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BsEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/IHwLoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/BnLoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/BpLoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/BsLoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/INoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/IHwNoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/BnNoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/BpNoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/BsNoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/IPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/IHwPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BnPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BpPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BsPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/IVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/IHwVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BnVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BpVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BsVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/IVisualizerEffect.h",
+        "android/hardware/audio/effect/2.0/IHwVisualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BnVisualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BpVisualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BsVisualizerEffect.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.audio.effect@2.0",
+    generated_sources: ["android.hardware.audio.effect@2.0_genc++"],
+    generated_headers: ["android.hardware.audio.effect@2.0_genc++_headers"],
+    export_generated_headers: ["android.hardware.audio.effect@2.0_genc++_headers"],
+    shared_libs: [
+        "libhidl",
+        "libhwbinder",
+        "libutils",
+        "libcutils",
+        "android.hardware.audio.common@2.0",
+    ],
+}