Audio HAL: Factorize V2 and V4 like libaudiohal
Use the same technique developed for the simpler libaudiohal to
factorize the audio HAL impl.
Generated with script:
set -euo pipefail
cd hardware/interfaces/audio
# Make 2.0 and 4.0 files mostly identical by removing all 2.0, V4.0...
# and replacing it by CPP_VERSION and FILE_VERSION
# This allow both implementation to be mostly identical, except for code difference
# Also remove IncludeGuard.h as it will be included from compiler flag
# Also update license to 2018
find -name *.cpp -o -name *h |
grep -v -e service.cpp |
xargs sed -Ei \
-e 's/(#.*)V[42]_0_(.*_H_?)$/\1\2/' \
-e 's/(LOG_TAG.*)[24]_0/\1/' \
-e '/#ifndef AUDIO_HAL_VERSION/,/#endif/d' \
-e '/^#.*def.*AUDIO_HAL_VERSION\b/d' \
-e's/V[42]_0/CPP_VERSION/' \
-e 's/(#include ).(android.*)[24].0(.*).$/\1PATH(\2FILE_VERSION\3)/' \
-e 's|(#include) .(.*)[24].0/(default/.*).$|\1 "\2\3"|' \
-e 's/\bAUDIO_HAL_VERSION\b/CPP_VERSION/' \
-e '/IncludeGuard.h/d' \
-e 's/(Copyright .C. 201)./\18/'
# set MAJOR_VERSION instead of having a different macro for each version
# this allow to do preprocessor arithmetic (eg: MAJOR_VERSION >= 4)
for v in 2 4; do
find -ipath '*/'$v'.0/*/Android.bp' |
xargs sed -i -e '/cflags:/,/^$/d' -e '/vndk/{:a;/}/!{N;ba};d}' -e '$i\
cflags: [\
"-DMAJOR_VERSION='$v'",\
"-DMINOR_VERSION=0",\
"-include common/all-versions/VersionMacro.h",\
]'; done
# replace# ifdef VERSION_X by #if MAJOR_VERSION == X
find -path *all-versions/*.h |
xargs sed -Ei -e 's/def.*AUDIO_HAL_VERSION_([24])_0.*/ MAJOR_VERSION == \1/' \
-e 'T;s/ +/ /'
# copy all-versions impl in each version impl
find -path '*/[24].0/*.[hc]*' |
grep -ve all-versions -e test |
xargs -P99 -n4 sed -i -Ee '/include <.*all-versions.default/!b' \
-e 's#.*<#find -path */#' -e 's/>$/|xargs tail -n +16/' -e e
# remove all-versions impl
rm -r {core,effect}/all-versions/
# merge version impl into a single all-version
for dir in core/*.0/vts/functional/*.0/ ;do
dest=$(echo $dir | sed 's#/..0/#/all-versions/#')
mkdir -p $dest
mv -T $dir $dest
done
find -mindepth 3 -path '*/2.0/*' -a \( -name '*cpp' -o -name '*h' \) |
grep -v 'all-versions' |
sed -E 'h;s/2/4/g;H;s/4.0/all-versions/;s/4.0//;H;g;s/\n/ /g;'|
xargs -P99 -L1 sh -c '
set -euo pipefail
mkdir -p $(dirname $2);
diff --old-group-format="#if MAJOR_VERSION == 2
%<#endif
" \
--new-group-format="#if MAJOR_VERSION == 4
%>#endif
" $0 $1 > $2 || true;
rm $0 $1'
# merge the X.0 Android.bp & OWNERS in the all-versions
for dir in common effect core; do
for sub in default vts/functional; do
test -f $dir/2.0/$sub/Android.bp || continue
awk 1 $dir/*.0/$sub/Android.bp >> $dir/all-versions/$sub/Android.bp
# delete licenses except for the first one and add whitelines
sed -i -e '/^}$/{N;/^}\n$/!s/\n/&\n/}' $dir/all-versions/$sub/Android.bp
sed -i -e '1,17b;/^\/\//,/^$/{d}' $dir/all-versions/$sub/Android.bp
done
for sub in default vts; do
test -d $dir/2.0/$sub || continue
test -f $dir/2.0/$sub/OWNERS &&
awk 1 $dir/*.0/$sub/OWNERS | sort -u > $dir/all-versions/$sub/OWNERS ||
true
rm -r $dir/*.0/$sub
done
done
# delete all-versions-impl dependencies
find -name 'Android.bp' | xargs sed -i -e '/all-versions-impl/d'
# cleanup unused files
rm common/all-versions/default/include/common/all-versions/default/HidlUtils*
rm common/all-versions/util/include/common/all-versions/IncludeGuard.h
find -depth -type d -empty -delete
# Clamp consecutive number of empty lines to 2
find -name *.cpp -o -name *h | xargs sed -Ei ':a;/^\n*$/{N;ba};s/\n\n+/\n\n/'
# transform #endif\n#if to #elif
find -name *.cpp -o -name *h | xargs sed -i '/^#endif/{N;s/.*\n#if/#elif/}'
# remove leftover include guard in cpp
find -name *.cpp |xargs sed -Ei '/^#.*_H_?$/d'
# apply clang-format
find -name *cpp -o -name *h |
xargs ../../../prebuilts/clang/host/linux-x86/clang-stable/bin/clang-format --style file -i
# clang format breaks PATH(a/b) to PATH(a / b), remove the space surrounding /
find -name *cpp -o -name *h | xargs sed -i "/#include PATH/s# / #/#g"
Test: compile
Bug: 118203066
Change-Id: I3692a444307afc5f71064fe0b9e6b8af3c9ff1dd
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp b/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp
deleted file mode 100644
index cadc2f1..0000000
--- a/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "AEC_Effect_HAL"
-
-#include "AcousticEchoCancelerEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/AcousticEchoCancelerEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/AcousticEchoCancelerEffect.h b/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
deleted file mode 100644
index d36335c..0000000
--- a/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
-
-#include <android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/AcousticEchoCancelerEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
diff --git a/audio/effect/2.0/default/Android.bp b/audio/effect/2.0/default/Android.bp
deleted file mode 100644
index db00988..0000000
--- a/audio/effect/2.0/default/Android.bp
+++ /dev/null
@@ -1,50 +0,0 @@
-cc_library_shared {
- name: "android.hardware.audio.effect@2.0-impl",
- defaults: ["hidl_defaults"],
- vendor: true,
- relative_install_path: "hw",
- srcs: [
- "AcousticEchoCancelerEffect.cpp",
- "AudioBufferManager.cpp",
- "AutomaticGainControlEffect.cpp",
- "BassBoostEffect.cpp",
- "Conversions.cpp",
- "DownmixEffect.cpp",
- "Effect.cpp",
- "EffectsFactory.cpp",
- "EnvironmentalReverbEffect.cpp",
- "EqualizerEffect.cpp",
- "LoudnessEnhancerEffect.cpp",
- "NoiseSuppressionEffect.cpp",
- "PresetReverbEffect.cpp",
- "VirtualizerEffect.cpp",
- "VisualizerEffect.cpp",
- ],
-
- shared_libs: [
- "libbase",
- "libcutils",
- "libeffects",
- "libfmq",
- "libhidlbase",
- "libhidlmemory",
- "libhidltransport",
- "liblog",
- "libutils",
- "android.hardware.audio.common-util",
- "android.hardware.audio.common@2.0",
- "android.hardware.audio.common@2.0-util",
- "android.hardware.audio.effect@2.0",
- "android.hidl.memory@1.0",
- ],
-
- header_libs: [
- "android.hardware.audio.common.util@all-versions",
- "android.hardware.audio.effect@all-versions-impl",
- "libaudio_system_headers",
- "libaudioclient_headers",
- "libeffects_headers",
- "libhardware_headers",
- "libmedia_headers",
- ],
-}
diff --git a/audio/effect/2.0/default/AudioBufferManager.cpp b/audio/effect/2.0/default/AudioBufferManager.cpp
deleted file mode 100644
index 39918dd..0000000
--- a/audio/effect/2.0/default/AudioBufferManager.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "AudioBufferManager.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/AudioBufferManager.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/AudioBufferManager.h b/audio/effect/2.0/default/AudioBufferManager.h
deleted file mode 100644
index 789fbd1..0000000
--- a/audio/effect/2.0/default/AudioBufferManager.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_
-
-#include <android/hardware/audio/effect/2.0/types.h>
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/AudioBufferManager.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_
diff --git a/audio/effect/2.0/default/AutomaticGainControlEffect.cpp b/audio/effect/2.0/default/AutomaticGainControlEffect.cpp
deleted file mode 100644
index 7e00a80..0000000
--- a/audio/effect/2.0/default/AutomaticGainControlEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "AGC_Effect_HAL"
-
-#include "AutomaticGainControlEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/AutomaticGainControlEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/AutomaticGainControlEffect.h b/audio/effect/2.0/default/AutomaticGainControlEffect.h
deleted file mode 100644
index ef440d2..0000000
--- a/audio/effect/2.0/default/AutomaticGainControlEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H
-
-#include <android/hardware/audio/effect/2.0/IAutomaticGainControlEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/AutomaticGainControlEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H
diff --git a/audio/effect/2.0/default/BassBoostEffect.cpp b/audio/effect/2.0/default/BassBoostEffect.cpp
deleted file mode 100644
index df9e892..0000000
--- a/audio/effect/2.0/default/BassBoostEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "BassBoost_HAL"
-
-#include "BassBoostEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/BassBoostEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/BassBoostEffect.h b/audio/effect/2.0/default/BassBoostEffect.h
deleted file mode 100644
index 83179e2..0000000
--- a/audio/effect/2.0/default/BassBoostEffect.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
-
-#include <android/hardware/audio/effect/2.0/IBassBoostEffect.h>
-
-#include <hidl/MQDescriptor.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/BassBoostEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
diff --git a/audio/effect/2.0/default/Conversions.cpp b/audio/effect/2.0/default/Conversions.cpp
deleted file mode 100644
index b59752c..0000000
--- a/audio/effect/2.0/default/Conversions.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Conversions.h"
-#include "HidlUtils.h"
-
-using ::android::hardware::audio::common::V2_0::HidlUtils;
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/Conversions.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/Conversions.h b/audio/effect/2.0/default/Conversions.h
deleted file mode 100644
index 94c7f66..0000000
--- a/audio/effect/2.0/default/Conversions.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_CONVERSIONS_H_
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_CONVERSIONS_H_
-
-#include <android/hardware/audio/effect/2.0/types.h>
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/Conversions.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_CONVERSIONS_H_
diff --git a/audio/effect/2.0/default/DownmixEffect.cpp b/audio/effect/2.0/default/DownmixEffect.cpp
deleted file mode 100644
index 1a51e13..0000000
--- a/audio/effect/2.0/default/DownmixEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Downmix_HAL"
-
-#include "DownmixEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/DownmixEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/DownmixEffect.h b/audio/effect/2.0/default/DownmixEffect.h
deleted file mode 100644
index 6dbbb32..0000000
--- a/audio/effect/2.0/default/DownmixEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H
-
-#include <android/hardware/audio/effect/2.0/IDownmixEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/DownmixEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H
diff --git a/audio/effect/2.0/default/Effect.cpp b/audio/effect/2.0/default/Effect.cpp
deleted file mode 100644
index e234e52..0000000
--- a/audio/effect/2.0/default/Effect.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <memory.h>
-
-#define LOG_TAG "EffectHAL"
-#define ATRACE_TAG ATRACE_TAG_AUDIO
-
-#include "Conversions.h"
-#include "Effect.h"
-#include "common/all-versions/default/EffectMap.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/Effect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/Effect.h b/audio/effect/2.0/default/Effect.h
deleted file mode 100644
index a4d194d..0000000
--- a/audio/effect/2.0/default/Effect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
-
-#include <android/hardware/audio/effect/2.0/IEffect.h>
-
-#include "AudioBufferManager.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/Effect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
diff --git a/audio/effect/2.0/default/EffectsFactory.cpp b/audio/effect/2.0/default/EffectsFactory.cpp
deleted file mode 100644
index a48a85f..0000000
--- a/audio/effect/2.0/default/EffectsFactory.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "EffectFactoryHAL"
-#include "EffectsFactory.h"
-#include "AcousticEchoCancelerEffect.h"
-#include "AutomaticGainControlEffect.h"
-#include "BassBoostEffect.h"
-#include "Conversions.h"
-#include "DownmixEffect.h"
-#include "Effect.h"
-#include "EnvironmentalReverbEffect.h"
-#include "EqualizerEffect.h"
-#include "HidlUtils.h"
-#include "LoudnessEnhancerEffect.h"
-#include "NoiseSuppressionEffect.h"
-#include "PresetReverbEffect.h"
-#include "VirtualizerEffect.h"
-#include "VisualizerEffect.h"
-#include "common/all-versions/default/EffectMap.h"
-
-using ::android::hardware::audio::common::V2_0::HidlUtils;
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/EffectsFactory.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/EffectsFactory.h b/audio/effect/2.0/default/EffectsFactory.h
deleted file mode 100644
index f1bfbcf..0000000
--- a/audio/effect/2.0/default/EffectsFactory.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H
-
-#include <system/audio_effect.h>
-
-#include <android/hardware/audio/effect/2.0/IEffectsFactory.h>
-
-#include <hidl/MQDescriptor.h>
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/EffectsFactory.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H
diff --git a/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp b/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp
deleted file mode 100644
index 017dd1f..0000000
--- a/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "EnvReverb_HAL"
-#include <android/log.h>
-
-#include "EnvironmentalReverbEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/EnvironmentalReverbEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/EnvironmentalReverbEffect.h b/audio/effect/2.0/default/EnvironmentalReverbEffect.h
deleted file mode 100644
index d93a53f..0000000
--- a/audio/effect/2.0/default/EnvironmentalReverbEffect.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H
-
-#include <system/audio_effects/effect_environmentalreverb.h>
-
-#include <android/hardware/audio/effect/2.0/IEnvironmentalReverbEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/EnvironmentalReverbEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H
diff --git a/audio/effect/2.0/default/EqualizerEffect.cpp b/audio/effect/2.0/default/EqualizerEffect.cpp
deleted file mode 100644
index d6e056c..0000000
--- a/audio/effect/2.0/default/EqualizerEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Equalizer_HAL"
-
-#include "EqualizerEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/EqualizerEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/EqualizerEffect.h b/audio/effect/2.0/default/EqualizerEffect.h
deleted file mode 100644
index 54cdd50..0000000
--- a/audio/effect/2.0/default/EqualizerEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H
-
-#include <android/hardware/audio/effect/2.0/IEqualizerEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/EqualizerEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H
diff --git a/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp b/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp
deleted file mode 100644
index 2dca0f4..0000000
--- a/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LoudnessEnhancer_HAL"
-
-#include "LoudnessEnhancerEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/LoudnessEnhancerEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/LoudnessEnhancerEffect.h b/audio/effect/2.0/default/LoudnessEnhancerEffect.h
deleted file mode 100644
index 992e238..0000000
--- a/audio/effect/2.0/default/LoudnessEnhancerEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H
-
-#include <android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/LoudnessEnhancerEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H
diff --git a/audio/effect/2.0/default/NoiseSuppressionEffect.cpp b/audio/effect/2.0/default/NoiseSuppressionEffect.cpp
deleted file mode 100644
index 089e811..0000000
--- a/audio/effect/2.0/default/NoiseSuppressionEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "NS_Effect_HAL"
-
-#include "NoiseSuppressionEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/NoiseSuppressionEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/NoiseSuppressionEffect.h b/audio/effect/2.0/default/NoiseSuppressionEffect.h
deleted file mode 100644
index 0eee4b5..0000000
--- a/audio/effect/2.0/default/NoiseSuppressionEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H
-
-#include <android/hardware/audio/effect/2.0/INoiseSuppressionEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/NoiseSuppressionEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H
diff --git a/audio/effect/2.0/default/OWNERS b/audio/effect/2.0/default/OWNERS
deleted file mode 100644
index 6fdc97c..0000000
--- a/audio/effect/2.0/default/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-elaurent@google.com
-krocard@google.com
-mnaganov@google.com
diff --git a/audio/effect/2.0/default/PresetReverbEffect.cpp b/audio/effect/2.0/default/PresetReverbEffect.cpp
deleted file mode 100644
index 0648f6a..0000000
--- a/audio/effect/2.0/default/PresetReverbEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "PresetReverb_HAL"
-
-#include "PresetReverbEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/PresetReverbEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/PresetReverbEffect.h b/audio/effect/2.0/default/PresetReverbEffect.h
deleted file mode 100644
index 1ea1626..0000000
--- a/audio/effect/2.0/default/PresetReverbEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H
-
-#include <android/hardware/audio/effect/2.0/IPresetReverbEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/PresetReverbEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H
diff --git a/audio/effect/2.0/default/VirtualizerEffect.cpp b/audio/effect/2.0/default/VirtualizerEffect.cpp
deleted file mode 100644
index 63d3eb9..0000000
--- a/audio/effect/2.0/default/VirtualizerEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Virtualizer_HAL"
-
-#include "VirtualizerEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/VirtualizerEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/VirtualizerEffect.h b/audio/effect/2.0/default/VirtualizerEffect.h
deleted file mode 100644
index 04f93c4..0000000
--- a/audio/effect/2.0/default/VirtualizerEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H
-
-#include <android/hardware/audio/effect/2.0/IVirtualizerEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/VirtualizerEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H
diff --git a/audio/effect/2.0/default/VisualizerEffect.cpp b/audio/effect/2.0/default/VisualizerEffect.cpp
deleted file mode 100644
index 5235524..0000000
--- a/audio/effect/2.0/default/VisualizerEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Visualizer_HAL"
-
-#include "VisualizerEffect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/VisualizerEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/2.0/default/VisualizerEffect.h b/audio/effect/2.0/default/VisualizerEffect.h
deleted file mode 100644
index 940f15d..0000000
--- a/audio/effect/2.0/default/VisualizerEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H
-
-#include <android/hardware/audio/effect/2.0/IVisualizerEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V2_0
-#include <effect/all-versions/default/VisualizerEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H
diff --git a/audio/effect/2.0/vts/functional/Android.bp b/audio/effect/2.0/vts/functional/Android.bp
deleted file mode 100644
index 38ca315..0000000
--- a/audio/effect/2.0/vts/functional/Android.bp
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Copyright (C) 2016 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-cc_test {
- name: "VtsHalAudioEffectV2_0TargetTest",
- defaults: ["VtsHalTargetTestDefaults"],
- srcs: [
- "VtsHalAudioEffectTargetTest.cpp",
- "ValidateAudioEffectsConfiguration.cpp"
- ],
- static_libs: [
- "android.hardware.audio.common.test.utility",
- "android.hardware.audio.common@2.0",
- "android.hardware.audio.effect@2.0",
- "android.hidl.allocator@1.0",
- "android.hidl.memory@1.0",
- "libeffectsconfig",
- "libicuuc",
- "libicuuc_stubdata",
- "libxml2",
- ],
- header_libs: [
- "android.hardware.audio.common.util@all-versions",
- ],
- test_suites: ["general-tests"],
-}
diff --git a/audio/effect/4.0/default/AcousticEchoCancelerEffect.cpp b/audio/effect/4.0/default/AcousticEchoCancelerEffect.cpp
deleted file mode 100644
index 242740e..0000000
--- a/audio/effect/4.0/default/AcousticEchoCancelerEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "AEC_Effect_HAL"
-
-#include "AcousticEchoCancelerEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/AcousticEchoCancelerEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/AcousticEchoCancelerEffect.h b/audio/effect/4.0/default/AcousticEchoCancelerEffect.h
deleted file mode 100644
index 0ac0a1e..0000000
--- a/audio/effect/4.0/default/AcousticEchoCancelerEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ACOUSTICECHOCANCELEREFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ACOUSTICECHOCANCELEREFFECT_H
-
-#include <android/hardware/audio/effect/4.0/IAcousticEchoCancelerEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/AcousticEchoCancelerEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ACOUSTICECHOCANCELEREFFECT_H
diff --git a/audio/effect/4.0/default/Android.bp b/audio/effect/4.0/default/Android.bp
deleted file mode 100644
index dcb2269..0000000
--- a/audio/effect/4.0/default/Android.bp
+++ /dev/null
@@ -1,50 +0,0 @@
-cc_library_shared {
- name: "android.hardware.audio.effect@4.0-impl",
- defaults: ["hidl_defaults"],
- vendor: true,
- relative_install_path: "hw",
- srcs: [
- "AcousticEchoCancelerEffect.cpp",
- "AudioBufferManager.cpp",
- "AutomaticGainControlEffect.cpp",
- "BassBoostEffect.cpp",
- "Conversions.cpp",
- "DownmixEffect.cpp",
- "Effect.cpp",
- "EffectsFactory.cpp",
- "EnvironmentalReverbEffect.cpp",
- "EqualizerEffect.cpp",
- "LoudnessEnhancerEffect.cpp",
- "NoiseSuppressionEffect.cpp",
- "PresetReverbEffect.cpp",
- "VirtualizerEffect.cpp",
- "VisualizerEffect.cpp",
- ],
-
- shared_libs: [
- "libbase",
- "libcutils",
- "libeffects",
- "libfmq",
- "libhidlbase",
- "libhidlmemory",
- "libhidltransport",
- "liblog",
- "libutils",
- "android.hardware.audio.common-util",
- "android.hardware.audio.common@4.0",
- "android.hardware.audio.common@4.0-util",
- "android.hardware.audio.effect@4.0",
- "android.hidl.memory@1.0",
- ],
-
- header_libs: [
- "android.hardware.audio.common.util@all-versions",
- "android.hardware.audio.effect@all-versions-impl",
- "libaudio_system_headers",
- "libaudioclient_headers",
- "libeffects_headers",
- "libhardware_headers",
- "libmedia_headers",
- ],
-}
diff --git a/audio/effect/4.0/default/AudioBufferManager.cpp b/audio/effect/4.0/default/AudioBufferManager.cpp
deleted file mode 100644
index 2d75f3f..0000000
--- a/audio/effect/4.0/default/AudioBufferManager.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "AudioBufferManager.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/AudioBufferManager.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/AudioBufferManager.h b/audio/effect/4.0/default/AudioBufferManager.h
deleted file mode 100644
index 1f151e6..0000000
--- a/audio/effect/4.0/default/AudioBufferManager.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_AUDIO_BUFFER_MANAGER_H_
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_AUDIO_BUFFER_MANAGER_H_
-
-#include <android/hardware/audio/effect/4.0/types.h>
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/AudioBufferManager.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_AUDIO_BUFFER_MANAGER_H_
diff --git a/audio/effect/4.0/default/AutomaticGainControlEffect.cpp b/audio/effect/4.0/default/AutomaticGainControlEffect.cpp
deleted file mode 100644
index 9d21c8a..0000000
--- a/audio/effect/4.0/default/AutomaticGainControlEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "AGC_Effect_HAL"
-
-#include "AutomaticGainControlEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/AutomaticGainControlEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/AutomaticGainControlEffect.h b/audio/effect/4.0/default/AutomaticGainControlEffect.h
deleted file mode 100644
index 7f12007..0000000
--- a/audio/effect/4.0/default/AutomaticGainControlEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_AUTOMATICGAINCONTROLEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_AUTOMATICGAINCONTROLEFFECT_H
-
-#include <android/hardware/audio/effect/4.0/IAutomaticGainControlEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/AutomaticGainControlEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_AUTOMATICGAINCONTROLEFFECT_H
diff --git a/audio/effect/4.0/default/BassBoostEffect.cpp b/audio/effect/4.0/default/BassBoostEffect.cpp
deleted file mode 100644
index 74a626b..0000000
--- a/audio/effect/4.0/default/BassBoostEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "BassBoost_HAL"
-
-#include "BassBoostEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/BassBoostEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/BassBoostEffect.h b/audio/effect/4.0/default/BassBoostEffect.h
deleted file mode 100644
index 206a75f..0000000
--- a/audio/effect/4.0/default/BassBoostEffect.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_BASSBOOSTEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_BASSBOOSTEFFECT_H
-
-#include <android/hardware/audio/effect/4.0/IBassBoostEffect.h>
-
-#include <hidl/MQDescriptor.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/BassBoostEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_BASSBOOSTEFFECT_H
diff --git a/audio/effect/4.0/default/Conversions.cpp b/audio/effect/4.0/default/Conversions.cpp
deleted file mode 100644
index 91285ae..0000000
--- a/audio/effect/4.0/default/Conversions.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Conversions.h"
-#include "HidlUtils.h"
-
-using ::android::hardware::audio::common::V4_0::HidlUtils;
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/Conversions.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/Conversions.h b/audio/effect/4.0/default/Conversions.h
deleted file mode 100644
index 50e380f..0000000
--- a/audio/effect/4.0/default/Conversions.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_CONVERSIONS_H_
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_CONVERSIONS_H_
-
-#include <android/hardware/audio/effect/4.0/types.h>
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/Conversions.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_CONVERSIONS_H_
diff --git a/audio/effect/4.0/default/DownmixEffect.cpp b/audio/effect/4.0/default/DownmixEffect.cpp
deleted file mode 100644
index 07fcab2..0000000
--- a/audio/effect/4.0/default/DownmixEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Downmix_HAL"
-
-#include "DownmixEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/DownmixEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/DownmixEffect.h b/audio/effect/4.0/default/DownmixEffect.h
deleted file mode 100644
index 5ae820b..0000000
--- a/audio/effect/4.0/default/DownmixEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_DOWNMIXEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_DOWNMIXEFFECT_H
-
-#include <android/hardware/audio/effect/4.0/IDownmixEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/DownmixEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_DOWNMIXEFFECT_H
diff --git a/audio/effect/4.0/default/Effect.cpp b/audio/effect/4.0/default/Effect.cpp
deleted file mode 100644
index 707044b..0000000
--- a/audio/effect/4.0/default/Effect.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <memory.h>
-
-#define LOG_TAG "EffectHAL"
-#define ATRACE_TAG ATRACE_TAG_AUDIO
-
-#include "Conversions.h"
-#include "Effect.h"
-#include "common/all-versions/default/EffectMap.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/Effect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/Effect.h b/audio/effect/4.0/default/Effect.h
deleted file mode 100644
index 9ca79c4..0000000
--- a/audio/effect/4.0/default/Effect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EFFECT_H
-
-#include <android/hardware/audio/effect/4.0/IEffect.h>
-
-#include "AudioBufferManager.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/Effect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EFFECT_H
diff --git a/audio/effect/4.0/default/EffectsFactory.cpp b/audio/effect/4.0/default/EffectsFactory.cpp
deleted file mode 100644
index ee0413d..0000000
--- a/audio/effect/4.0/default/EffectsFactory.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "EffectFactoryHAL"
-#include "EffectsFactory.h"
-#include "AcousticEchoCancelerEffect.h"
-#include "AutomaticGainControlEffect.h"
-#include "BassBoostEffect.h"
-#include "Conversions.h"
-#include "DownmixEffect.h"
-#include "Effect.h"
-#include "EnvironmentalReverbEffect.h"
-#include "EqualizerEffect.h"
-#include "HidlUtils.h"
-#include "LoudnessEnhancerEffect.h"
-#include "NoiseSuppressionEffect.h"
-#include "PresetReverbEffect.h"
-#include "VirtualizerEffect.h"
-#include "VisualizerEffect.h"
-#include "common/all-versions/default/EffectMap.h"
-
-using ::android::hardware::audio::common::V4_0::HidlUtils;
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/EffectsFactory.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/EffectsFactory.h b/audio/effect/4.0/default/EffectsFactory.h
deleted file mode 100644
index 48e4b4c..0000000
--- a/audio/effect/4.0/default/EffectsFactory.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EFFECTSFACTORY_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EFFECTSFACTORY_H
-
-#include <system/audio_effect.h>
-
-#include <android/hardware/audio/effect/4.0/IEffectsFactory.h>
-
-#include <hidl/MQDescriptor.h>
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/EffectsFactory.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EFFECTSFACTORY_H
diff --git a/audio/effect/4.0/default/EnvironmentalReverbEffect.cpp b/audio/effect/4.0/default/EnvironmentalReverbEffect.cpp
deleted file mode 100644
index cc3102d..0000000
--- a/audio/effect/4.0/default/EnvironmentalReverbEffect.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "EnvReverb_HAL"
-#include <android/log.h>
-
-#include "EnvironmentalReverbEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/EnvironmentalReverbEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/EnvironmentalReverbEffect.h b/audio/effect/4.0/default/EnvironmentalReverbEffect.h
deleted file mode 100644
index c0fb25c..0000000
--- a/audio/effect/4.0/default/EnvironmentalReverbEffect.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ENVIRONMENTALREVERBEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ENVIRONMENTALREVERBEFFECT_H
-
-#include <system/audio_effects/effect_environmentalreverb.h>
-
-#include <android/hardware/audio/effect/4.0/IEnvironmentalReverbEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/EnvironmentalReverbEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ENVIRONMENTALREVERBEFFECT_H
diff --git a/audio/effect/4.0/default/EqualizerEffect.cpp b/audio/effect/4.0/default/EqualizerEffect.cpp
deleted file mode 100644
index d0a40bc..0000000
--- a/audio/effect/4.0/default/EqualizerEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Equalizer_HAL"
-
-#include "EqualizerEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/EqualizerEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/EqualizerEffect.h b/audio/effect/4.0/default/EqualizerEffect.h
deleted file mode 100644
index 7c9463b..0000000
--- a/audio/effect/4.0/default/EqualizerEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EQUALIZEREFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EQUALIZEREFFECT_H
-
-#include <android/hardware/audio/effect/4.0/IEqualizerEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/EqualizerEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EQUALIZEREFFECT_H
diff --git a/audio/effect/4.0/default/LoudnessEnhancerEffect.cpp b/audio/effect/4.0/default/LoudnessEnhancerEffect.cpp
deleted file mode 100644
index e3c5184..0000000
--- a/audio/effect/4.0/default/LoudnessEnhancerEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LoudnessEnhancer_HAL"
-
-#include "LoudnessEnhancerEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/LoudnessEnhancerEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/LoudnessEnhancerEffect.h b/audio/effect/4.0/default/LoudnessEnhancerEffect.h
deleted file mode 100644
index 64fa26a..0000000
--- a/audio/effect/4.0/default/LoudnessEnhancerEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_LOUDNESSENHANCEREFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_LOUDNESSENHANCEREFFECT_H
-
-#include <android/hardware/audio/effect/4.0/ILoudnessEnhancerEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/LoudnessEnhancerEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_LOUDNESSENHANCEREFFECT_H
diff --git a/audio/effect/4.0/default/NoiseSuppressionEffect.cpp b/audio/effect/4.0/default/NoiseSuppressionEffect.cpp
deleted file mode 100644
index e83a8e3..0000000
--- a/audio/effect/4.0/default/NoiseSuppressionEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "NS_Effect_HAL"
-
-#include "NoiseSuppressionEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/NoiseSuppressionEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/NoiseSuppressionEffect.h b/audio/effect/4.0/default/NoiseSuppressionEffect.h
deleted file mode 100644
index 36d45af..0000000
--- a/audio/effect/4.0/default/NoiseSuppressionEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_NOISESUPPRESSIONEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_NOISESUPPRESSIONEFFECT_H
-
-#include <android/hardware/audio/effect/4.0/INoiseSuppressionEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/NoiseSuppressionEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_NOISESUPPRESSIONEFFECT_H
diff --git a/audio/effect/4.0/default/OWNERS b/audio/effect/4.0/default/OWNERS
deleted file mode 100644
index 6fdc97c..0000000
--- a/audio/effect/4.0/default/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-elaurent@google.com
-krocard@google.com
-mnaganov@google.com
diff --git a/audio/effect/4.0/default/PresetReverbEffect.cpp b/audio/effect/4.0/default/PresetReverbEffect.cpp
deleted file mode 100644
index 0c23be7..0000000
--- a/audio/effect/4.0/default/PresetReverbEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "PresetReverb_HAL"
-
-#include "PresetReverbEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/PresetReverbEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/PresetReverbEffect.h b/audio/effect/4.0/default/PresetReverbEffect.h
deleted file mode 100644
index 3eeae0a..0000000
--- a/audio/effect/4.0/default/PresetReverbEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_PRESETREVERBEFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_PRESETREVERBEFFECT_H
-
-#include <android/hardware/audio/effect/4.0/IPresetReverbEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/PresetReverbEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_PRESETREVERBEFFECT_H
diff --git a/audio/effect/4.0/default/VirtualizerEffect.cpp b/audio/effect/4.0/default/VirtualizerEffect.cpp
deleted file mode 100644
index f50e8ad..0000000
--- a/audio/effect/4.0/default/VirtualizerEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Virtualizer_HAL"
-
-#include "VirtualizerEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/VirtualizerEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/VirtualizerEffect.h b/audio/effect/4.0/default/VirtualizerEffect.h
deleted file mode 100644
index 8e7114e..0000000
--- a/audio/effect/4.0/default/VirtualizerEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_VIRTUALIZEREFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_VIRTUALIZEREFFECT_H
-
-#include <android/hardware/audio/effect/4.0/IVirtualizerEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/VirtualizerEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_VIRTUALIZEREFFECT_H
diff --git a/audio/effect/4.0/default/VisualizerEffect.cpp b/audio/effect/4.0/default/VisualizerEffect.cpp
deleted file mode 100644
index 8d4f100..0000000
--- a/audio/effect/4.0/default/VisualizerEffect.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Visualizer_HAL"
-
-#include "VisualizerEffect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/VisualizerEffect.impl.h>
-#undef AUDIO_HAL_VERSION
diff --git a/audio/effect/4.0/default/VisualizerEffect.h b/audio/effect/4.0/default/VisualizerEffect.h
deleted file mode 100644
index 6b5ab9c..0000000
--- a/audio/effect/4.0/default/VisualizerEffect.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_VISUALIZEREFFECT_H
-#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_VISUALIZEREFFECT_H
-
-#include <android/hardware/audio/effect/4.0/IVisualizerEffect.h>
-
-#include "Effect.h"
-
-#define AUDIO_HAL_VERSION V4_0
-#include <effect/all-versions/default/VisualizerEffect.h>
-#undef AUDIO_HAL_VERSION
-
-#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_VISUALIZEREFFECT_H
diff --git a/audio/effect/4.0/vts/OWNERS b/audio/effect/4.0/vts/OWNERS
deleted file mode 100644
index 8711a9f..0000000
--- a/audio/effect/4.0/vts/OWNERS
+++ /dev/null
@@ -1,5 +0,0 @@
-elaurent@google.com
-krocard@google.com
-mnaganov@google.com
-yim@google.com
-zhuoyao@google.com
\ No newline at end of file
diff --git a/audio/effect/4.0/vts/functional/Android.bp b/audio/effect/4.0/vts/functional/Android.bp
deleted file mode 100644
index 4589e51..0000000
--- a/audio/effect/4.0/vts/functional/Android.bp
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Copyright (C) 2016 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-cc_test {
- name: "VtsHalAudioEffectV4_0TargetTest",
- defaults: ["VtsHalTargetTestDefaults"],
- srcs: [
- "VtsHalAudioEffectTargetTest.cpp",
- "ValidateAudioEffectsConfiguration.cpp"
- ],
- static_libs: [
- "android.hardware.audio.common.test.utility",
- "android.hardware.audio.common@4.0",
- "android.hardware.audio.effect@4.0",
- "android.hidl.allocator@1.0",
- "android.hidl.memory@1.0",
- "libeffectsconfig",
- "libicuuc",
- "libicuuc_stubdata",
- "libxml2",
- ],
- header_libs: [
- "android.hardware.audio.common.util@all-versions",
- ],
- test_suites: ["general-tests"],
-}
diff --git a/audio/effect/4.0/vts/functional/ValidateAudioEffectsConfiguration.cpp b/audio/effect/4.0/vts/functional/ValidateAudioEffectsConfiguration.cpp
deleted file mode 100644
index 2e94143..0000000
--- a/audio/effect/4.0/vts/functional/ValidateAudioEffectsConfiguration.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <unistd.h>
-#include <iterator>
-
-#include <media/EffectsConfig.h>
-
-#include "utility/ValidateXml.h"
-
-// Stringify the argument.
-#define QUOTE(x) #x
-#define STRINGIFY(x) QUOTE(x)
-
-#define AUDIO_HAL_VERSION V4_0
-
-TEST(CheckConfig, audioEffectsConfigurationValidation) {
- RecordProperty("description",
- "Verify that the effects configuration file is valid according to the schema");
- using namespace android::effectsConfig;
-
- std::vector<const char*> locations(std::begin(DEFAULT_LOCATIONS), std::end(DEFAULT_LOCATIONS));
- const char* xsd = "/data/local/tmp/audio_effects_conf_" STRINGIFY(AUDIO_HAL_VERSION) ".xsd";
- // Starting with V4, audio effect XML is required
- EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS(DEFAULT_NAME, locations, xsd);
-}
diff --git a/audio/effect/4.0/vts/functional/VtsHalAudioEffectTargetTest.cpp b/audio/effect/4.0/vts/functional/VtsHalAudioEffectTargetTest.cpp
deleted file mode 100644
index 96b8602..0000000
--- a/audio/effect/4.0/vts/functional/VtsHalAudioEffectTargetTest.cpp
+++ /dev/null
@@ -1,827 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "AudioEffectHidlHalTest"
-#include <android-base/logging.h>
-#include <system/audio.h>
-
-#include <android/hardware/audio/effect/4.0/IEffect.h>
-#include <android/hardware/audio/effect/4.0/IEffectsFactory.h>
-#include <android/hardware/audio/effect/4.0/IEqualizerEffect.h>
-#include <android/hardware/audio/effect/4.0/ILoudnessEnhancerEffect.h>
-#include <android/hardware/audio/effect/4.0/types.h>
-#include <android/hidl/allocator/1.0/IAllocator.h>
-#include <android/hidl/memory/1.0/IMemory.h>
-
-#include <common/all-versions/VersionUtils.h>
-
-#include <VtsHalHidlTargetTestBase.h>
-#include <VtsHalHidlTargetTestEnvBase.h>
-
-using android::sp;
-using android::hardware::hidl_handle;
-using android::hardware::hidl_memory;
-using android::hardware::hidl_string;
-using android::hardware::hidl_vec;
-using android::hardware::MQDescriptorSync;
-using android::hardware::Return;
-using android::hardware::Void;
-using android::hardware::audio::common::utils::mkEnumBitfield;
-using android::hardware::audio::common::V4_0::AudioDevice;
-using android::hardware::audio::common::V4_0::AudioHandleConsts;
-using android::hardware::audio::common::V4_0::AudioMode;
-using android::hardware::audio::common::V4_0::AudioSource;
-using android::hardware::audio::common::V4_0::Uuid;
-using android::hardware::audio::effect::V4_0::AudioBuffer;
-using android::hardware::audio::effect::V4_0::EffectAuxChannelsConfig;
-using android::hardware::audio::effect::V4_0::EffectBufferConfig;
-using android::hardware::audio::effect::V4_0::EffectConfig;
-using android::hardware::audio::effect::V4_0::EffectDescriptor;
-using android::hardware::audio::effect::V4_0::EffectOffloadParameter;
-using android::hardware::audio::effect::V4_0::IEffect;
-using android::hardware::audio::effect::V4_0::IEffectsFactory;
-using android::hardware::audio::effect::V4_0::IEqualizerEffect;
-using android::hardware::audio::effect::V4_0::ILoudnessEnhancerEffect;
-using android::hardware::audio::effect::V4_0::Result;
-using android::hidl::allocator::V1_0::IAllocator;
-using android::hidl::memory::V1_0::IMemory;
-
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
-#endif
-
-// Test environment for Audio Effects Factory HIDL HAL.
-class AudioEffectsFactoryHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
- public:
- // get the test environment singleton
- static AudioEffectsFactoryHidlEnvironment* Instance() {
- static AudioEffectsFactoryHidlEnvironment* instance =
- new AudioEffectsFactoryHidlEnvironment;
- return instance;
- }
-
- virtual void registerTestServices() override { registerTestService<IEffectsFactory>(); }
-};
-
-// The main test class for Audio Effects Factory HIDL HAL.
-class AudioEffectsFactoryHidlTest : public ::testing::VtsHalHidlTargetTestBase {
- public:
- void SetUp() override {
- effectsFactory = ::testing::VtsHalHidlTargetTestBase::getService<IEffectsFactory>(
- AudioEffectsFactoryHidlEnvironment::Instance()->getServiceName<IEffectsFactory>());
- ASSERT_NE(effectsFactory, nullptr);
- }
-
- void TearDown() override { effectsFactory.clear(); }
-
- protected:
- static void description(const std::string& description) {
- RecordProperty("description", description);
- }
-
- sp<IEffectsFactory> effectsFactory;
-};
-
-TEST_F(AudioEffectsFactoryHidlTest, EnumerateEffects) {
- description("Verify that EnumerateEffects returns at least one effect");
- Result retval = Result::NOT_INITIALIZED;
- size_t effectCount = 0;
- Return<void> ret =
- effectsFactory->getAllDescriptors([&](Result r, const hidl_vec<EffectDescriptor>& result) {
- retval = r;
- effectCount = result.size();
- });
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_GT(effectCount, 0u);
-}
-
-TEST_F(AudioEffectsFactoryHidlTest, CreateEffect) {
- description("Verify that an effect can be created via CreateEffect");
- bool gotEffect = false;
- Uuid effectUuid;
- Return<void> ret =
- effectsFactory->getAllDescriptors([&](Result r, const hidl_vec<EffectDescriptor>& result) {
- if (r == Result::OK && result.size() > 0) {
- gotEffect = true;
- effectUuid = result[0].uuid;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_TRUE(gotEffect);
- Result retval = Result::NOT_INITIALIZED;
- sp<IEffect> effect;
- ret = effectsFactory->createEffect(
- effectUuid, 1 /*session*/, 1 /*ioHandle*/,
- [&](Result r, const sp<IEffect>& result, uint64_t /*effectId*/) {
- retval = r;
- if (r == Result::OK) {
- effect = result;
- }
- });
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_NE(nullptr, effect.get());
-}
-
-TEST_F(AudioEffectsFactoryHidlTest, GetDescriptor) {
- description(
- "Verify that effects factory can provide an effect descriptor via "
- "GetDescriptor");
- hidl_vec<EffectDescriptor> allDescriptors;
- Return<void> ret =
- effectsFactory->getAllDescriptors([&](Result r, const hidl_vec<EffectDescriptor>& result) {
- if (r == Result::OK) {
- allDescriptors = result;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_GT(allDescriptors.size(), 0u);
- for (size_t i = 0; i < allDescriptors.size(); ++i) {
- ret = effectsFactory->getDescriptor(allDescriptors[i].uuid,
- [&](Result r, const EffectDescriptor& result) {
- EXPECT_EQ(r, Result::OK);
- EXPECT_EQ(result, allDescriptors[i]);
- });
- }
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectsFactoryHidlTest, DebugDumpInvalidArgument) {
- description("Verify that debugDump doesn't crash on invalid arguments");
- Return<void> ret = effectsFactory->debug(hidl_handle(), {});
- ASSERT_TRUE(ret.isOk());
-}
-
-// Equalizer effect is required by CDD, but only the type is fixed.
-// This is the same UUID as AudioEffect.EFFECT_TYPE_EQUALIZER in Java.
-static const Uuid EQUALIZER_EFFECT_TYPE = {
- 0x0bed4300, 0xddd6, 0x11db, 0x8f34,
- std::array<uint8_t, 6>{{0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}};
-// Loudness Enhancer effect is required by CDD, but only the type is fixed.
-// This is the same UUID as AudioEffect.EFFECT_TYPE_LOUDNESS_ENHANCER in Java.
-static const Uuid LOUDNESS_ENHANCER_EFFECT_TYPE = {
- 0xfe3199be, 0xaed0, 0x413f, 0x87bb,
- std::array<uint8_t, 6>{{0x11, 0x26, 0x0e, 0xb6, 0x3c, 0xf1}}};
-
-// The main test class for Audio Effect HIDL HAL.
-class AudioEffectHidlTest : public ::testing::VtsHalHidlTargetTestBase {
- public:
- void SetUp() override {
- effectsFactory = ::testing::VtsHalHidlTargetTestBase::getService<IEffectsFactory>();
- ASSERT_NE(nullptr, effectsFactory.get());
-
- findAndCreateEffect(getEffectType());
- ASSERT_NE(nullptr, effect.get());
-
- Return<Result> ret = effect->init();
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, ret);
- }
-
- void TearDown() override {
- effect.clear();
- effectsFactory.clear();
- }
-
- protected:
- static void description(const std::string& description) {
- RecordProperty("description", description);
- }
-
- virtual Uuid getEffectType() { return EQUALIZER_EFFECT_TYPE; }
-
- void findAndCreateEffect(const Uuid& type);
- void findEffectInstance(const Uuid& type, Uuid* uuid);
- void getChannelCount(uint32_t* channelCount);
-
- sp<IEffectsFactory> effectsFactory;
- sp<IEffect> effect;
-};
-
-void AudioEffectHidlTest::findAndCreateEffect(const Uuid& type) {
- Uuid effectUuid;
- findEffectInstance(type, &effectUuid);
- Return<void> ret = effectsFactory->createEffect(
- effectUuid, 1 /*session*/, 1 /*ioHandle*/,
- [&](Result r, const sp<IEffect>& result, uint64_t /*effectId*/) {
- if (r == Result::OK) {
- effect = result;
- }
- });
- ASSERT_TRUE(ret.isOk());
-}
-
-void AudioEffectHidlTest::findEffectInstance(const Uuid& type, Uuid* uuid) {
- bool effectFound = false;
- Return<void> ret =
- effectsFactory->getAllDescriptors([&](Result r, const hidl_vec<EffectDescriptor>& result) {
- if (r == Result::OK) {
- for (const auto& desc : result) {
- if (desc.type == type) {
- effectFound = true;
- *uuid = desc.uuid;
- break;
- }
- }
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_TRUE(effectFound);
-}
-
-void AudioEffectHidlTest::getChannelCount(uint32_t* channelCount) {
- Result retval;
- EffectConfig currentConfig;
- Return<void> ret = effect->getConfig([&](Result r, const EffectConfig& conf) {
- retval = r;
- if (r == Result::OK) {
- currentConfig = conf;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
- ASSERT_TRUE(audio_channel_mask_is_valid(
- static_cast<audio_channel_mask_t>(currentConfig.outputCfg.channels)));
- *channelCount = audio_channel_count_from_out_mask(
- static_cast<audio_channel_mask_t>(currentConfig.outputCfg.channels));
-}
-
-TEST_F(AudioEffectHidlTest, Close) {
- description("Verify that an effect can be closed");
- Return<Result> ret = effect->close();
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
-}
-
-TEST_F(AudioEffectHidlTest, GetDescriptor) {
- description("Verify that an effect can return its own descriptor via GetDescriptor");
- Result retval = Result::NOT_INITIALIZED;
- Uuid actualType;
- Return<void> ret = effect->getDescriptor([&](Result r, const EffectDescriptor& desc) {
- retval = r;
- if (r == Result::OK) {
- actualType = desc.type;
- }
- });
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(getEffectType(), actualType);
-}
-
-TEST_F(AudioEffectHidlTest, GetSetConfig) {
- description(
- "Verify that it is possible to manipulate effect config via Get / "
- "SetConfig");
- Result retval = Result::NOT_INITIALIZED;
- EffectConfig currentConfig;
- Return<void> ret = effect->getConfig([&](Result r, const EffectConfig& conf) {
- retval = r;
- if (r == Result::OK) {
- currentConfig = conf;
- }
- });
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
- Return<Result> ret2 = effect->setConfig(currentConfig, nullptr, nullptr);
- EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, ret2);
-}
-
-TEST_F(AudioEffectHidlTest, GetConfigReverse) {
- description("Verify that GetConfigReverse does not crash");
- Return<void> ret = effect->getConfigReverse([&](Result, const EffectConfig&) {});
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, GetSupportedAuxChannelsConfigs) {
- description("Verify that GetSupportedAuxChannelsConfigs does not crash");
- Return<void> ret = effect->getSupportedAuxChannelsConfigs(
- 0, [&](Result, const hidl_vec<EffectAuxChannelsConfig>&) {});
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, GetAuxChannelsConfig) {
- description("Verify that GetAuxChannelsConfig does not crash");
- Return<void> ret = effect->getAuxChannelsConfig([&](Result, const EffectAuxChannelsConfig&) {});
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, SetAuxChannelsConfig) {
- description("Verify that SetAuxChannelsConfig does not crash");
- Return<Result> ret = effect->setAuxChannelsConfig(EffectAuxChannelsConfig());
- EXPECT_TRUE(ret.isOk());
-}
-
-// Not generated automatically because AudioBuffer contains
-// instances of hidl_memory which can't be compared properly
-// in general case due to presence of handles.
-//
-// However, in this particular case, handles must not present
-// thus comparison is possible.
-//
-// operator== must be defined in the same namespace as the structures.
-namespace android {
-namespace hardware {
-namespace audio {
-namespace effect {
-namespace V4_0 {
-inline bool operator==(const AudioBuffer& lhs, const AudioBuffer& rhs) {
- return lhs.id == rhs.id && lhs.frameCount == rhs.frameCount && lhs.data.handle() == nullptr &&
- rhs.data.handle() == nullptr;
-}
-
-inline bool operator==(const EffectBufferConfig& lhs, const EffectBufferConfig& rhs) {
- return lhs.buffer == rhs.buffer && lhs.samplingRateHz == rhs.samplingRateHz &&
- lhs.channels == rhs.channels && lhs.format == rhs.format &&
- lhs.accessMode == rhs.accessMode && lhs.mask == rhs.mask;
-}
-
-inline bool operator==(const EffectConfig& lhs, const EffectConfig& rhs) {
- return lhs.inputCfg == rhs.inputCfg && lhs.outputCfg == rhs.outputCfg;
-}
-} // namespace V4_0
-} // namespace effect
-} // namespace audio
-} // namespace hardware
-} // namespace android
-
-TEST_F(AudioEffectHidlTest, Reset) {
- description("Verify that Reset preserves effect configuration");
- Result retval = Result::NOT_INITIALIZED;
- EffectConfig originalConfig;
- Return<void> ret = effect->getConfig([&](Result r, const EffectConfig& conf) {
- retval = r;
- if (r == Result::OK) {
- originalConfig = conf;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
- Return<Result> ret2 = effect->reset();
- EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, ret2);
- EffectConfig configAfterReset;
- ret = effect->getConfig([&](Result r, const EffectConfig& conf) {
- retval = r;
- if (r == Result::OK) {
- configAfterReset = conf;
- }
- });
- EXPECT_EQ(originalConfig, configAfterReset);
-}
-
-TEST_F(AudioEffectHidlTest, DisableEnableDisable) {
- description("Verify Disable -> Enable -> Disable sequence for an effect");
- Return<Result> ret = effect->disable();
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::INVALID_ARGUMENTS, ret);
- ret = effect->enable();
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
- ret = effect->disable();
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
-}
-
-TEST_F(AudioEffectHidlTest, SetDevice) {
- description("Verify that SetDevice works for an output chain effect");
- Return<Result> ret = effect->setDevice(mkEnumBitfield(AudioDevice::OUT_SPEAKER));
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
-}
-
-TEST_F(AudioEffectHidlTest, SetAndGetVolume) {
- description("Verify that SetAndGetVolume method works for an effect");
- uint32_t channelCount;
- getChannelCount(&channelCount);
- hidl_vec<uint32_t> volumes;
- volumes.resize(channelCount);
- for (uint32_t i = 0; i < channelCount; ++i) {
- volumes[i] = 0;
- }
- Result retval = Result::NOT_INITIALIZED;
- Return<void> ret =
- effect->setAndGetVolume(volumes, [&](Result r, const hidl_vec<uint32_t>&) { retval = r; });
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
-}
-
-TEST_F(AudioEffectHidlTest, VolumeChangeNotification) {
- description("Verify that effect accepts VolumeChangeNotification");
- uint32_t channelCount;
- getChannelCount(&channelCount);
- hidl_vec<uint32_t> volumes;
- volumes.resize(channelCount);
- for (uint32_t i = 0; i < channelCount; ++i) {
- volumes[i] = 0;
- }
- Return<Result> ret = effect->volumeChangeNotification(volumes);
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
-}
-
-TEST_F(AudioEffectHidlTest, SetAudioMode) {
- description("Verify that SetAudioMode works for an effect");
- Return<Result> ret = effect->setAudioMode(AudioMode::NORMAL);
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
-}
-
-TEST_F(AudioEffectHidlTest, SetConfigReverse) {
- description("Verify that SetConfigReverse does not crash");
- Return<Result> ret = effect->setConfigReverse(EffectConfig(), nullptr, nullptr);
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, SetInputDevice) {
- description("Verify that SetInputDevice does not crash");
- Return<Result> ret = effect->setInputDevice(mkEnumBitfield(AudioDevice::IN_BUILTIN_MIC));
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, SetAudioSource) {
- description("Verify that SetAudioSource does not crash");
- Return<Result> ret = effect->setAudioSource(AudioSource::MIC);
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, Offload) {
- description("Verify that calling Offload method does not crash");
- EffectOffloadParameter offloadParam;
- offloadParam.isOffload = false;
- offloadParam.ioHandle = static_cast<int>(AudioHandleConsts::AUDIO_IO_HANDLE_NONE);
- Return<Result> ret = effect->offload(offloadParam);
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, PrepareForProcessing) {
- description("Verify that PrepareForProcessing method works for an effect");
- Result retval = Result::NOT_INITIALIZED;
- Return<void> ret = effect->prepareForProcessing(
- [&](Result r, const MQDescriptorSync<Result>&) { retval = r; });
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
-}
-
-TEST_F(AudioEffectHidlTest, SetProcessBuffers) {
- description("Verify that SetProcessBuffers works for an effect");
- sp<IAllocator> ashmem = IAllocator::getService("ashmem");
- ASSERT_NE(nullptr, ashmem.get());
- bool success = false;
- AudioBuffer buffer;
- Return<void> ret = ashmem->allocate(1024, [&](bool s, const hidl_memory& memory) {
- success = s;
- if (s) {
- buffer.data = memory;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_TRUE(success);
- Return<Result> ret2 = effect->setProcessBuffers(buffer, buffer);
- EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, ret2);
-}
-
-TEST_F(AudioEffectHidlTest, Command) {
- description("Verify that Command does not crash");
- Return<void> ret =
- effect->command(0, hidl_vec<uint8_t>(), 0, [&](int32_t, const hidl_vec<uint8_t>&) {});
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, SetParameter) {
- description("Verify that SetParameter does not crash");
- Return<Result> ret = effect->setParameter(hidl_vec<uint8_t>(), hidl_vec<uint8_t>());
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, GetParameter) {
- description("Verify that GetParameter does not crash");
- Return<void> ret =
- effect->getParameter(hidl_vec<uint8_t>(), 0, [&](Result, const hidl_vec<uint8_t>&) {});
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, GetSupportedConfigsForFeature) {
- description("Verify that GetSupportedConfigsForFeature does not crash");
- Return<void> ret = effect->getSupportedConfigsForFeature(
- 0, 0, 0, [&](Result, uint32_t, const hidl_vec<uint8_t>&) {});
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, GetCurrentConfigForFeature) {
- description("Verify that GetCurrentConfigForFeature does not crash");
- Return<void> ret =
- effect->getCurrentConfigForFeature(0, 0, [&](Result, const hidl_vec<uint8_t>&) {});
- EXPECT_TRUE(ret.isOk());
-}
-
-TEST_F(AudioEffectHidlTest, SetCurrentConfigForFeature) {
- description("Verify that SetCurrentConfigForFeature does not crash");
- Return<Result> ret = effect->setCurrentConfigForFeature(0, hidl_vec<uint8_t>());
- EXPECT_TRUE(ret.isOk());
-}
-
-// The main test class for Equalizer Audio Effect HIDL HAL.
-class EqualizerAudioEffectHidlTest : public AudioEffectHidlTest {
- public:
- void SetUp() override {
- AudioEffectHidlTest::SetUp();
- equalizer = IEqualizerEffect::castFrom(effect);
- ASSERT_NE(nullptr, equalizer.get());
- }
-
- protected:
- Uuid getEffectType() override { return EQUALIZER_EFFECT_TYPE; }
- void getNumBands(uint16_t* numBands);
- void getLevelRange(int16_t* minLevel, int16_t* maxLevel);
- void getBandFrequencyRange(uint16_t band, uint32_t* minFreq, uint32_t* centerFreq,
- uint32_t* maxFreq);
- void getPresetCount(size_t* count);
-
- sp<IEqualizerEffect> equalizer;
-};
-
-void EqualizerAudioEffectHidlTest::getNumBands(uint16_t* numBands) {
- Result retval = Result::NOT_INITIALIZED;
- Return<void> ret = equalizer->getNumBands([&](Result r, uint16_t b) {
- retval = r;
- if (retval == Result::OK) {
- *numBands = b;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
-}
-
-void EqualizerAudioEffectHidlTest::getLevelRange(int16_t* minLevel, int16_t* maxLevel) {
- Result retval = Result::NOT_INITIALIZED;
- Return<void> ret = equalizer->getLevelRange([&](Result r, int16_t min, int16_t max) {
- retval = r;
- if (retval == Result::OK) {
- *minLevel = min;
- *maxLevel = max;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
-}
-
-void EqualizerAudioEffectHidlTest::getBandFrequencyRange(uint16_t band, uint32_t* minFreq,
- uint32_t* centerFreq, uint32_t* maxFreq) {
- Result retval = Result::NOT_INITIALIZED;
- Return<void> ret =
- equalizer->getBandFrequencyRange(band, [&](Result r, uint32_t min, uint32_t max) {
- retval = r;
- if (retval == Result::OK) {
- *minFreq = min;
- *maxFreq = max;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
- ret = equalizer->getBandCenterFrequency(band, [&](Result r, uint32_t center) {
- retval = r;
- if (retval == Result::OK) {
- *centerFreq = center;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
-}
-
-void EqualizerAudioEffectHidlTest::getPresetCount(size_t* count) {
- Result retval = Result::NOT_INITIALIZED;
- Return<void> ret = equalizer->getPresetNames([&](Result r, const hidl_vec<hidl_string>& names) {
- retval = r;
- if (retval == Result::OK) {
- *count = names.size();
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
-}
-
-TEST_F(EqualizerAudioEffectHidlTest, GetNumBands) {
- description("Verify that Equalizer effect reports at least one band");
- uint16_t numBands = 0;
- getNumBands(&numBands);
- EXPECT_GT(numBands, 0);
-}
-
-TEST_F(EqualizerAudioEffectHidlTest, GetLevelRange) {
- description("Verify that Equalizer effect reports adequate band level range");
- int16_t minLevel = 0x7fff, maxLevel = 0;
- getLevelRange(&minLevel, &maxLevel);
- EXPECT_GT(maxLevel, minLevel);
-}
-
-TEST_F(EqualizerAudioEffectHidlTest, GetSetBandLevel) {
- description("Verify that manipulating band levels works for Equalizer effect");
- uint16_t numBands = 0;
- getNumBands(&numBands);
- ASSERT_GT(numBands, 0);
- int16_t levels[3]{0x7fff, 0, 0};
- getLevelRange(&levels[0], &levels[2]);
- ASSERT_GT(levels[2], levels[0]);
- levels[1] = (levels[2] + levels[0]) / 2;
- for (uint16_t i = 0; i < numBands; ++i) {
- for (size_t j = 0; j < ARRAY_SIZE(levels); ++j) {
- Return<Result> ret = equalizer->setBandLevel(i, levels[j]);
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
- Result retval = Result::NOT_INITIALIZED;
- int16_t actualLevel;
- Return<void> ret2 = equalizer->getBandLevel(i, [&](Result r, int16_t l) {
- retval = r;
- if (retval == Result::OK) {
- actualLevel = l;
- }
- });
- EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(levels[j], actualLevel);
- }
- }
-}
-
-TEST_F(EqualizerAudioEffectHidlTest, GetBandCenterFrequencyAndRange) {
- description("Verify that Equalizer effect reports adequate band frequency range");
- uint16_t numBands = 0;
- getNumBands(&numBands);
- ASSERT_GT(numBands, 0);
- for (uint16_t i = 0; i < numBands; ++i) {
- uint32_t minFreq = 0xffffffff, centerFreq = 0xffffffff, maxFreq = 0xffffffff;
- getBandFrequencyRange(i, &minFreq, ¢erFreq, &maxFreq);
- // Note: NXP legacy implementation reports "1" as upper bound for last band,
- // so this check fails.
- EXPECT_GE(maxFreq, centerFreq);
- EXPECT_GE(centerFreq, minFreq);
- }
-}
-
-TEST_F(EqualizerAudioEffectHidlTest, GetBandForFrequency) {
- description("Verify that Equalizer effect supports GetBandForFrequency correctly");
- uint16_t numBands = 0;
- getNumBands(&numBands);
- ASSERT_GT(numBands, 0);
- for (uint16_t i = 0; i < numBands; ++i) {
- uint32_t freqs[3]{0, 0, 0};
- getBandFrequencyRange(i, &freqs[0], &freqs[1], &freqs[2]);
- // NXP legacy implementation reports "1" as upper bound for last band, some
- // of the checks fail.
- for (size_t j = 0; j < ARRAY_SIZE(freqs); ++j) {
- if (j == 0) {
- freqs[j]++;
- } // Min frequency is an open interval.
- Result retval = Result::NOT_INITIALIZED;
- uint16_t actualBand = numBands + 1;
- Return<void> ret = equalizer->getBandForFrequency(freqs[j], [&](Result r, uint16_t b) {
- retval = r;
- if (retval == Result::OK) {
- actualBand = b;
- }
- });
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(i, actualBand) << "Frequency: " << freqs[j];
- }
- }
-}
-
-TEST_F(EqualizerAudioEffectHidlTest, GetPresetNames) {
- description("Verify that Equalizer effect reports at least one preset");
- size_t presetCount;
- getPresetCount(&presetCount);
- EXPECT_GT(presetCount, 0u);
-}
-
-TEST_F(EqualizerAudioEffectHidlTest, GetSetCurrentPreset) {
- description("Verify that manipulating the current preset for Equalizer effect");
- size_t presetCount;
- getPresetCount(&presetCount);
- ASSERT_GT(presetCount, 0u);
- for (uint16_t i = 0; i < presetCount; ++i) {
- Return<Result> ret = equalizer->setCurrentPreset(i);
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
- Result retval = Result::NOT_INITIALIZED;
- uint16_t actualPreset = 0xffff;
- Return<void> ret2 = equalizer->getCurrentPreset([&](Result r, uint16_t p) {
- retval = r;
- if (retval == Result::OK) {
- actualPreset = p;
- }
- });
- EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(i, actualPreset);
- }
-}
-
-TEST_F(EqualizerAudioEffectHidlTest, GetSetAllProperties) {
- description(
- "Verify that setting band levels and presets works via Get / "
- "SetAllProperties for Equalizer effect");
- using AllProperties = android::hardware::audio::effect::V4_0::IEqualizerEffect::AllProperties;
- uint16_t numBands = 0;
- getNumBands(&numBands);
- ASSERT_GT(numBands, 0);
- AllProperties props;
- props.bandLevels.resize(numBands);
- for (size_t i = 0; i < numBands; ++i) {
- props.bandLevels[i] = 0;
- }
-
- AllProperties actualProps;
- Result retval = Result::NOT_INITIALIZED;
-
- // Verify setting of the band levels via properties.
- props.curPreset = -1;
- Return<Result> ret = equalizer->setAllProperties(props);
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
- Return<void> ret2 = equalizer->getAllProperties([&](Result r, AllProperties p) {
- retval = r;
- if (retval == Result::OK) {
- actualProps = p;
- }
- });
- EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(props.bandLevels, actualProps.bandLevels);
-
- // Verify setting of the current preset via properties.
- props.curPreset = 0; // Assuming there is at least one preset.
- ret = equalizer->setAllProperties(props);
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
- ret2 = equalizer->getAllProperties([&](Result r, AllProperties p) {
- retval = r;
- if (retval == Result::OK) {
- actualProps = p;
- }
- });
- EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(props.curPreset, actualProps.curPreset);
-}
-
-// The main test class for Equalizer Audio Effect HIDL HAL.
-class LoudnessEnhancerAudioEffectHidlTest : public AudioEffectHidlTest {
- public:
- void SetUp() override {
- AudioEffectHidlTest::SetUp();
- enhancer = ILoudnessEnhancerEffect::castFrom(effect);
- ASSERT_NE(nullptr, enhancer.get());
- }
-
- protected:
- Uuid getEffectType() override { return LOUDNESS_ENHANCER_EFFECT_TYPE; }
-
- sp<ILoudnessEnhancerEffect> enhancer;
-};
-
-TEST_F(LoudnessEnhancerAudioEffectHidlTest, GetSetTargetGain) {
- description(
- "Verify that manipulating the target gain works for Loudness Enhancer "
- "effect");
- const int32_t gain = 100;
- Return<Result> ret = enhancer->setTargetGain(gain);
- EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
- int32_t actualGain = 0;
- Result retval;
- Return<void> ret2 = enhancer->getTargetGain([&](Result r, int32_t g) {
- retval = r;
- if (retval == Result::OK) {
- actualGain = g;
- }
- });
- EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(gain, actualGain);
-}
-
-int main(int argc, char** argv) {
- ::testing::AddGlobalTestEnvironment(AudioEffectsFactoryHidlEnvironment::Instance());
- ::testing::InitGoogleTest(&argc, argv);
- AudioEffectsFactoryHidlEnvironment::Instance()->init(&argc, argv);
- int status = RUN_ALL_TESTS();
- LOG(INFO) << "Test result = " << status;
- return status;
-}
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h b/audio/effect/all-versions/default/AcousticEchoCancelerEffect.cpp
similarity index 94%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h
rename to audio/effect/all-versions/default/AcousticEchoCancelerEffect.cpp
index 8ad80a2..0b60622 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h
+++ b/audio/effect/all-versions/default/AcousticEchoCancelerEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "AEC_Effect_HAL"
+
+#include "AcousticEchoCancelerEffect.h"
#include <android/log.h>
#include <system/audio_effects/effect_aec.h>
@@ -25,7 +27,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
AcousticEchoCancelerEffect::AcousticEchoCancelerEffect(effect_handle_t handle)
@@ -33,7 +35,7 @@
AcousticEchoCancelerEffect::~AcousticEchoCancelerEffect() {}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> AcousticEchoCancelerEffect::init() {
return mEffect->init();
}
@@ -163,7 +165,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAcousticEchoCancelerEffect
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IAcousticEchoCancelerEffect
// follow.
Return<Result> AcousticEchoCancelerEffect::setEchoDelay(uint32_t echoDelayMs) {
return mEffect->setParam(AEC_PARAM_ECHO_DELAY, echoDelayMs);
@@ -174,7 +176,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.h b/audio/effect/all-versions/default/AcousticEchoCancelerEffect.h
similarity index 85%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.h
rename to audio/effect/all-versions/default/AcousticEchoCancelerEffect.h
index 37744b3..c18f88b 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.h
+++ b/audio/effect/all-versions/default/AcousticEchoCancelerEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_ACOUSTICECHOCANCELEREFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_ACOUSTICECHOCANCELEREFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IAcousticEchoCancelerEffect.h)
+
+#include "Effect.h"
#include <hidl/Status.h>
@@ -26,7 +31,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -34,13 +39,13 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAcousticEchoCancelerEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::effect::CPP_VERSION::IAcousticEchoCancelerEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect {
explicit AcousticEchoCancelerEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -85,7 +90,7 @@
Return<Result> close() override;
// Methods from
- // ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAcousticEchoCancelerEffect follow.
+ // ::android::hardware::audio::effect::CPP_VERSION::IAcousticEchoCancelerEffect follow.
Return<Result> setEchoDelay(uint32_t echoDelayMs) override;
Return<void> getEchoDelay(getEchoDelay_cb _hidl_cb) override;
@@ -96,8 +101,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_ACOUSTICECHOCANCELEREFFECT_H
diff --git a/audio/effect/all-versions/default/Android.bp b/audio/effect/all-versions/default/Android.bp
index ed2a093..ce41481 100644
--- a/audio/effect/all-versions/default/Android.bp
+++ b/audio/effect/all-versions/default/Android.bp
@@ -1,10 +1,25 @@
-cc_library_headers {
- name: "android.hardware.audio.effect@all-versions-impl",
+cc_library_shared {
+ name: "android.hardware.audio.effect@2.0-impl",
defaults: ["hidl_defaults"],
vendor: true,
relative_install_path: "hw",
-
- export_include_dirs: ["include"],
+ srcs: [
+ "AcousticEchoCancelerEffect.cpp",
+ "AudioBufferManager.cpp",
+ "AutomaticGainControlEffect.cpp",
+ "BassBoostEffect.cpp",
+ "Conversions.cpp",
+ "DownmixEffect.cpp",
+ "Effect.cpp",
+ "EffectsFactory.cpp",
+ "EnvironmentalReverbEffect.cpp",
+ "EqualizerEffect.cpp",
+ "LoudnessEnhancerEffect.cpp",
+ "NoiseSuppressionEffect.cpp",
+ "PresetReverbEffect.cpp",
+ "VirtualizerEffect.cpp",
+ "VisualizerEffect.cpp",
+ ],
shared_libs: [
"libbase",
@@ -17,15 +32,78 @@
"liblog",
"libutils",
"android.hardware.audio.common-util",
+ "android.hardware.audio.common@2.0",
+ "android.hardware.audio.common@2.0-util",
+ "android.hardware.audio.effect@2.0",
"android.hidl.memory@1.0",
],
header_libs: [
+ "android.hardware.audio.common.util@all-versions",
"libaudio_system_headers",
"libaudioclient_headers",
"libeffects_headers",
"libhardware_headers",
"libmedia_headers",
- "android.hardware.audio.common.util@all-versions",
],
+ cflags: [
+ "-DMAJOR_VERSION=2",
+ "-DMINOR_VERSION=0",
+ "-include common/all-versions/VersionMacro.h",
+ ]
+}
+
+cc_library_shared {
+ name: "android.hardware.audio.effect@4.0-impl",
+ defaults: ["hidl_defaults"],
+ vendor: true,
+ relative_install_path: "hw",
+ srcs: [
+ "AcousticEchoCancelerEffect.cpp",
+ "AudioBufferManager.cpp",
+ "AutomaticGainControlEffect.cpp",
+ "BassBoostEffect.cpp",
+ "Conversions.cpp",
+ "DownmixEffect.cpp",
+ "Effect.cpp",
+ "EffectsFactory.cpp",
+ "EnvironmentalReverbEffect.cpp",
+ "EqualizerEffect.cpp",
+ "LoudnessEnhancerEffect.cpp",
+ "NoiseSuppressionEffect.cpp",
+ "PresetReverbEffect.cpp",
+ "VirtualizerEffect.cpp",
+ "VisualizerEffect.cpp",
+ ],
+
+ shared_libs: [
+ "libbase",
+ "libcutils",
+ "libeffects",
+ "libfmq",
+ "libhidlbase",
+ "libhidlmemory",
+ "libhidltransport",
+ "liblog",
+ "libutils",
+ "android.hardware.audio.common-util",
+ "android.hardware.audio.common@4.0",
+ "android.hardware.audio.common@4.0-util",
+ "android.hardware.audio.effect@4.0",
+ "android.hidl.memory@1.0",
+ ],
+
+ header_libs: [
+ "android.hardware.audio.common.util@all-versions",
+ "libaudio_system_headers",
+ "libaudioclient_headers",
+ "libeffects_headers",
+ "libhardware_headers",
+ "libmedia_headers",
+ ],
+ cflags: [
+ "-DMAJOR_VERSION=4",
+ "-DMINOR_VERSION=0",
+ "-include common/all-versions/VersionMacro.h",
+ ]
}
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.impl.h b/audio/effect/all-versions/default/AudioBufferManager.cpp
similarity index 93%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.impl.h
rename to audio/effect/all-versions/default/AudioBufferManager.cpp
index 71ccd2d..9a638fd 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.impl.h
+++ b/audio/effect/all-versions/default/AudioBufferManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#include "AudioBufferManager.h"
#include <atomic>
@@ -53,7 +53,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
AudioBufferWrapper::AudioBufferWrapper(const AudioBuffer& buffer)
@@ -83,7 +83,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.h b/audio/effect/all-versions/default/AudioBufferManager.h
similarity index 75%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.h
rename to audio/effect/all-versions/default/AudioBufferManager.h
index 34dea2d..8b956cd 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.h
+++ b/audio/effect/all-versions/default/AudioBufferManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,10 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_AUDIO_BUFFER_MANAGER_H_
+#define ANDROID_HARDWARE_AUDIO_EFFECT_AUDIO_BUFFER_MANAGER_H_
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/types.h)
#include <mutex>
@@ -24,14 +27,14 @@
#include <utils/RefBase.h>
#include <utils/Singleton.h>
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
+using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
using ::android::hidl::memory::V1_0::IMemory;
namespace android {
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
class AudioBufferWrapper : public RefBase {
@@ -51,13 +54,13 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::implementation::AudioBufferWrapper;
+using ::android::hardware::audio::effect::CPP_VERSION::implementation::AudioBufferWrapper;
namespace android {
@@ -67,7 +70,7 @@
bool wrap(const AudioBuffer& buffer, sp<AudioBufferWrapper>* wrapper);
private:
- friend class hardware::audio::effect::AUDIO_HAL_VERSION::implementation::AudioBufferWrapper;
+ friend class hardware::audio::effect::CPP_VERSION::implementation::AudioBufferWrapper;
// Called by AudioBufferWrapper.
void removeEntry(uint64_t id);
@@ -77,3 +80,5 @@
};
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_AUDIO_BUFFER_MANAGER_H_
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h b/audio/effect/all-versions/default/AutomaticGainControlEffect.cpp
similarity index 95%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h
rename to audio/effect/all-versions/default/AutomaticGainControlEffect.cpp
index e2e751e..651dd1b 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h
+++ b/audio/effect/all-versions/default/AutomaticGainControlEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "AGC_Effect_HAL"
+
+#include "AutomaticGainControlEffect.h"
#include <android/log.h>
@@ -24,7 +26,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
AutomaticGainControlEffect::AutomaticGainControlEffect(effect_handle_t handle)
@@ -46,7 +48,7 @@
halProperties->limiterEnabled = properties.limiterEnabled;
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> AutomaticGainControlEffect::init() {
return mEffect->init();
}
@@ -176,7 +178,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAutomaticGainControlEffect
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IAutomaticGainControlEffect
// follow.
Return<Result> AutomaticGainControlEffect::setTargetLevel(int16_t targetLevelMb) {
return mEffect->setParam(AGC_PARAM_TARGET_LEVEL, targetLevelMb);
@@ -219,7 +221,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.h b/audio/effect/all-versions/default/AutomaticGainControlEffect.h
similarity index 87%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.h
rename to audio/effect/all-versions/default/AutomaticGainControlEffect.h
index fce6cd6..a281b1d 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.h
+++ b/audio/effect/all-versions/default/AutomaticGainControlEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_AUTOMATICGAINCONTROLEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_AUTOMATICGAINCONTROLEFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IAutomaticGainControlEffect.h)
+
+#include "Effect.h"
#include <system/audio_effects/effect_agc.h>
@@ -28,7 +33,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -36,13 +41,13 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAutomaticGainControlEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::effect::CPP_VERSION::IAutomaticGainControlEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct AutomaticGainControlEffect : public IAutomaticGainControlEffect {
explicit AutomaticGainControlEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -87,7 +92,7 @@
Return<Result> close() override;
// Methods from
- // ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAutomaticGainControlEffect follow.
+ // ::android::hardware::audio::effect::CPP_VERSION::IAutomaticGainControlEffect follow.
Return<Result> setTargetLevel(int16_t targetLevelMb) override;
Return<void> getTargetLevel(getTargetLevel_cb _hidl_cb) override;
Return<Result> setCompGain(int16_t compGainMb) override;
@@ -110,8 +115,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_AUTOMATICGAINCONTROLEFFECT_H
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.impl.h b/audio/effect/all-versions/default/BassBoostEffect.cpp
similarity index 93%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.impl.h
rename to audio/effect/all-versions/default/BassBoostEffect.cpp
index 7bcb4a3..6f7763d 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.impl.h
+++ b/audio/effect/all-versions/default/BassBoostEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "BassBoost_HAL"
+
+#include "BassBoostEffect.h"
#include <android/log.h>
#include <system/audio_effects/effect_bassboost.h>
@@ -25,14 +27,14 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
BassBoostEffect::BassBoostEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {}
BassBoostEffect::~BassBoostEffect() {}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> BassBoostEffect::init() {
return mEffect->init();
}
@@ -159,7 +161,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IBassBoostEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IBassBoostEffect follow.
Return<void> BassBoostEffect::isStrengthSupported(isStrengthSupported_cb _hidl_cb) {
return mEffect->getIntegerParam(BASSBOOST_PARAM_STRENGTH_SUPPORTED, _hidl_cb);
}
@@ -173,7 +175,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.h b/audio/effect/all-versions/default/BassBoostEffect.h
similarity index 85%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.h
rename to audio/effect/all-versions/default/BassBoostEffect.h
index b79e7a4..a184ac2 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.h
+++ b/audio/effect/all-versions/default/BassBoostEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,14 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_BASSBOOSTEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_BASSBOOSTEFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IBassBoostEffect.h)
+
+#include <hidl/MQDescriptor.h>
+
+#include "Effect.h"
#include <hidl/Status.h>
@@ -26,7 +33,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -34,13 +41,13 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IBassBoostEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::effect::CPP_VERSION::IBassBoostEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct BassBoostEffect : public IBassBoostEffect {
explicit BassBoostEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -84,7 +91,7 @@
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IBassBoostEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IBassBoostEffect follow.
Return<void> isStrengthSupported(isStrengthSupported_cb _hidl_cb) override;
Return<Result> setStrength(uint16_t strength) override;
Return<void> getStrength(getStrength_cb _hidl_cb) override;
@@ -96,8 +103,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_BASSBOOSTEFFECT_H
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.impl.h b/audio/effect/all-versions/default/Conversions.cpp
similarity index 86%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.impl.h
rename to audio/effect/all-versions/default/Conversions.cpp
index 0884d8f..50b0562 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.impl.h
+++ b/audio/effect/all-versions/default/Conversions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,21 +14,24 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#include "Conversions.h"
+#include "HidlUtils.h"
+
+using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
#include <memory.h>
#include <stdio.h>
#include <common/all-versions/VersionUtils.h>
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::HidlUtils;
+using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
using ::android::hardware::audio::common::utils::EnumBitfield;
namespace android {
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
void effectDescriptorFromHal(const effect_descriptor_t& halDescriptor,
@@ -52,7 +55,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.h b/audio/effect/all-versions/default/Conversions.h
similarity index 71%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.h
rename to audio/effect/all-versions/default/Conversions.h
index 3f9317f..75aab24 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.h
+++ b/audio/effect/all-versions/default/Conversions.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,10 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_CONVERSIONS_H_
+#define ANDROID_HARDWARE_AUDIO_EFFECT_CONVERSIONS_H_
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/types.h)
#include <string>
@@ -24,18 +27,20 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
void effectDescriptorFromHal(const effect_descriptor_t& halDescriptor,
EffectDescriptor* descriptor);
std::string uuidToString(const effect_uuid_t& halUuid);
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_CONVERSIONS_H_
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.impl.h b/audio/effect/all-versions/default/DownmixEffect.cpp
similarity index 93%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.impl.h
rename to audio/effect/all-versions/default/DownmixEffect.cpp
index abef10e..94da70e 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.impl.h
+++ b/audio/effect/all-versions/default/DownmixEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "Downmix_HAL"
+
+#include "DownmixEffect.h"
#include <android/log.h>
#include <system/audio_effects/effect_downmix.h>
@@ -25,14 +27,14 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
DownmixEffect::DownmixEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {}
DownmixEffect::~DownmixEffect() {}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> DownmixEffect::init() {
return mEffect->init();
}
@@ -159,7 +161,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IDownmixEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IDownmixEffect follow.
Return<Result> DownmixEffect::setType(IDownmixEffect::Type preset) {
return mEffect->setParam(DOWNMIX_PARAM_TYPE, static_cast<downmix_type_t>(preset));
}
@@ -172,7 +174,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.h b/audio/effect/all-versions/default/DownmixEffect.h
similarity index 86%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.h
rename to audio/effect/all-versions/default/DownmixEffect.h
index dbbb64c..6d34c28 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.h
+++ b/audio/effect/all-versions/default/DownmixEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_DOWNMIXEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_DOWNMIXEFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IDownmixEffect.h)
+
+#include "Effect.h"
#include <hidl/Status.h>
@@ -26,7 +31,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -34,13 +39,13 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IDownmixEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::effect::CPP_VERSION::IDownmixEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct DownmixEffect : public IDownmixEffect {
explicit DownmixEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -84,7 +89,7 @@
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IDownmixEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IDownmixEffect follow.
Return<Result> setType(IDownmixEffect::Type preset) override;
Return<void> getType(getType_cb _hidl_cb) override;
@@ -95,8 +100,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_DOWNMIXEFFECT_H
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.impl.h b/audio/effect/all-versions/default/Effect.cpp
similarity index 97%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/Effect.impl.h
rename to audio/effect/all-versions/default/Effect.cpp
index 61c9805..3e5148f 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.impl.h
+++ b/audio/effect/all-versions/default/Effect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,14 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#include <memory.h>
+
+#define LOG_TAG "EffectHAL"
+#define ATRACE_TAG ATRACE_TAG_AUDIO
+
+#include "Conversions.h"
+#include "Effect.h"
+#include "common/all-versions/default/EffectMap.h"
#include <memory.h>
@@ -30,13 +37,13 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioChannelMask;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioFormat;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::implementation::AudioChannelBitfield;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::MessageQueueFlagBits;
+using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask;
+using ::android::hardware::audio::common::CPP_VERSION::AudioFormat;
+using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioChannelBitfield;
+using ::android::hardware::audio::effect::CPP_VERSION::MessageQueueFlagBits;
namespace {
@@ -479,7 +486,7 @@
&halParamBuffer[0]);
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> Effect::init() {
return sendCommandReturningStatus(EFFECT_CMD_INIT, "INIT");
}
@@ -707,7 +714,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.h b/audio/effect/all-versions/default/Effect.h
similarity index 88%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/Effect.h
rename to audio/effect/all-versions/default/Effect.h
index 0b62ccc..f6a12d9 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.h
+++ b/audio/effect/all-versions/default/Effect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_EFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_EFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IEffect.h)
+
+#include "AudioBufferManager.h"
#include <atomic>
#include <memory>
@@ -34,7 +39,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -42,20 +47,20 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::Uuid;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::implementation::AudioDeviceBitfield;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectFeature;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
+using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
+using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
+using ::android::hardware::audio::common::CPP_VERSION::Uuid;
+using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioDeviceBitfield;
+using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectFeature;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct Effect : public IEffect {
typedef MessageQueue<Result, kSynchronizedReadWrite> StatusMQ;
@@ -64,7 +69,7 @@
explicit Effect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -234,8 +239,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_EFFECT_H
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.impl.h b/audio/effect/all-versions/default/EffectsFactory.cpp
similarity index 88%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.impl.h
rename to audio/effect/all-versions/default/EffectsFactory.cpp
index f3256f1..d2d8a46 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.impl.h
+++ b/audio/effect/all-versions/default/EffectsFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,25 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "EffectFactoryHAL"
+#include "EffectsFactory.h"
+#include "AcousticEchoCancelerEffect.h"
+#include "AutomaticGainControlEffect.h"
+#include "BassBoostEffect.h"
+#include "Conversions.h"
+#include "DownmixEffect.h"
+#include "Effect.h"
+#include "EnvironmentalReverbEffect.h"
+#include "EqualizerEffect.h"
+#include "HidlUtils.h"
+#include "LoudnessEnhancerEffect.h"
+#include "NoiseSuppressionEffect.h"
+#include "PresetReverbEffect.h"
+#include "VirtualizerEffect.h"
+#include "VisualizerEffect.h"
+#include "common/all-versions/default/EffectMap.h"
+
+using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
#include <android/log.h>
#include <media/EffectsFactoryApi.h>
@@ -30,13 +48,13 @@
#include <system/audio_effects/effect_virtualizer.h>
#include <system/audio_effects/effect_visualizer.h>
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::HidlUtils;
+using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
namespace android {
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
// static
@@ -69,7 +87,7 @@
return new Effect(handle);
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory follow.
Return<void> EffectsFactory::getAllDescriptors(getAllDescriptors_cb _hidl_cb) {
Result retval(Result::OK);
hidl_vec<EffectDescriptor> result;
@@ -189,7 +207,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.h b/audio/effect/all-versions/default/EffectsFactory.h
similarity index 66%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.h
rename to audio/effect/all-versions/default/EffectsFactory.h
index dd37434..0cbfaa2 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.h
+++ b/audio/effect/all-versions/default/EffectsFactory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,14 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_EFFECTSFACTORY_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_EFFECTSFACTORY_H
+
+#include <system/audio_effect.h>
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IEffectsFactory.h)
+
+#include <hidl/MQDescriptor.h>
#include <hardware/audio_effect.h>
#include <system/audio_effect.h>
@@ -26,7 +33,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -34,20 +41,20 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::Uuid;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::common::CPP_VERSION::Uuid;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct EffectsFactory : public IEffectsFactory {
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory follow.
Return<void> getAllDescriptors(getAllDescriptors_cb _hidl_cb) override;
Return<void> getDescriptor(const Uuid& uid, getDescriptor_cb _hidl_cb) override;
Return<void> createEffect(const Uuid& uid, int32_t session, int32_t ioHandle,
createEffect_cb _hidl_cb) override;
Return<void> debugDump(
- const hidl_handle& fd); //< in V2_0::IEffectsFactory only, alias of debug
+ const hidl_handle& fd); //< in CPP_VERSION::IEffectsFactory only, alias of debug
Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
private:
@@ -58,8 +65,10 @@
extern "C" IEffectsFactory* HIDL_FETCH_IEffectsFactory(const char* name);
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_EFFECTSFACTORY_H
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h b/audio/effect/all-versions/default/EnvironmentalReverbEffect.cpp
similarity index 96%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h
rename to audio/effect/all-versions/default/EnvironmentalReverbEffect.cpp
index 39a4092..1ade7b8 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h
+++ b/audio/effect/all-versions/default/EnvironmentalReverbEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,10 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "EnvReverb_HAL"
+#include <android/log.h>
+
+#include "EnvironmentalReverbEffect.h"
#include <android/log.h>
@@ -24,7 +27,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
EnvironmentalReverbEffect::EnvironmentalReverbEffect(effect_handle_t handle)
@@ -60,7 +63,7 @@
halProperties->density = properties.density;
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> EnvironmentalReverbEffect::init() {
return mEffect->init();
}
@@ -190,7 +193,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEnvironmentalReverbEffect
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEnvironmentalReverbEffect
// follow.
Return<Result> EnvironmentalReverbEffect::setBypass(bool bypass) {
return mEffect->setParam(REVERB_PARAM_BYPASS, bypass);
@@ -297,7 +300,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.h b/audio/effect/all-versions/default/EnvironmentalReverbEffect.h
similarity index 80%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.h
rename to audio/effect/all-versions/default/EnvironmentalReverbEffect.h
index 2215cf8..7e6597b 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.h
+++ b/audio/effect/all-versions/default/EnvironmentalReverbEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,14 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_ENVIRONMENTALREVERBEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_ENVIRONMENTALREVERBEFFECT_H
+
+#include <system/audio_effects/effect_environmentalreverb.h>
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IEnvironmentalReverbEffect.h)
+
+#include "Effect.h"
#include <system/audio_effects/effect_environmentalreverb.h>
@@ -28,7 +35,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -36,23 +43,23 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEnvironmentalReverbEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
+using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
+using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
+using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
+using ::android::hardware::audio::effect::CPP_VERSION::IEnvironmentalReverbEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect {
explicit EnvironmentalReverbEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -97,7 +104,7 @@
Return<Result> close() override;
// Methods from
- // ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEnvironmentalReverbEffect follow.
+ // ::android::hardware::audio::effect::CPP_VERSION::IEnvironmentalReverbEffect follow.
Return<Result> setBypass(bool bypass) override;
Return<void> getBypass(getBypass_cb _hidl_cb) override;
Return<Result> setRoomLevel(int16_t roomLevel) override;
@@ -136,8 +143,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_ENVIRONMENTALREVERBEFFECT_H
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.impl.h b/audio/effect/all-versions/default/EqualizerEffect.cpp
similarity index 96%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.impl.h
rename to audio/effect/all-versions/default/EqualizerEffect.cpp
index db6bed8..f6177b7 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.impl.h
+++ b/audio/effect/all-versions/default/EqualizerEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "Equalizer_HAL"
+
+#include "EqualizerEffect.h"
#include <memory.h>
@@ -26,7 +28,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
EqualizerEffect::EqualizerEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {}
@@ -55,7 +57,7 @@
return halBuffer;
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> EqualizerEffect::init() {
return mEffect->init();
}
@@ -182,7 +184,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEqualizerEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect follow.
Return<void> EqualizerEffect::getNumBands(getNumBands_cb _hidl_cb) {
return mEffect->getIntegerParam(EQ_PARAM_NUM_BANDS, _hidl_cb);
}
@@ -285,7 +287,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.h b/audio/effect/all-versions/default/EqualizerEffect.h
similarity index 79%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.h
rename to audio/effect/all-versions/default/EqualizerEffect.h
index e150465..5e1e2b9 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.h
+++ b/audio/effect/all-versions/default/EqualizerEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_EQUALIZEREFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_EQUALIZEREFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IEqualizerEffect.h)
+
+#include "Effect.h"
#include <vector>
@@ -30,7 +35,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -38,23 +43,23 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEqualizerEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
+using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
+using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
+using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
+using ::android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct EqualizerEffect : public IEqualizerEffect {
explicit EqualizerEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -98,7 +103,7 @@
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEqualizerEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect follow.
Return<void> getNumBands(getNumBands_cb _hidl_cb) override;
Return<void> getLevelRange(getLevelRange_cb _hidl_cb) override;
Return<Result> setBandLevel(uint16_t band, int16_t level) override;
@@ -124,8 +129,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_EQUALIZEREFFECT_H
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h b/audio/effect/all-versions/default/LoudnessEnhancerEffect.cpp
similarity index 94%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h
rename to audio/effect/all-versions/default/LoudnessEnhancerEffect.cpp
index 88210e9..6918bdf 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h
+++ b/audio/effect/all-versions/default/LoudnessEnhancerEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "LoudnessEnhancer_HAL"
+
+#include "LoudnessEnhancerEffect.h"
#include <system/audio_effects/effect_loudnessenhancer.h>
@@ -27,7 +29,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
LoudnessEnhancerEffect::LoudnessEnhancerEffect(effect_handle_t handle)
@@ -35,7 +37,7 @@
LoudnessEnhancerEffect::~LoudnessEnhancerEffect() {}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> LoudnessEnhancerEffect::init() {
return mEffect->init();
}
@@ -162,7 +164,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::ILoudnessEnhancerEffect
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::ILoudnessEnhancerEffect
// follow.
Return<Result> LoudnessEnhancerEffect::setTargetGain(int32_t targetGainMb) {
return mEffect->setParam(LOUDNESS_ENHANCER_DEFAULT_TARGET_GAIN_MB, targetGainMb);
@@ -182,7 +184,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.h b/audio/effect/all-versions/default/LoudnessEnhancerEffect.h
similarity index 75%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.h
rename to audio/effect/all-versions/default/LoudnessEnhancerEffect.h
index 182e791..6eb8a8c 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.h
+++ b/audio/effect/all-versions/default/LoudnessEnhancerEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_LOUDNESSENHANCEREFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_LOUDNESSENHANCEREFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/ILoudnessEnhancerEffect.h)
+
+#include "Effect.h"
#include <hidl/Status.h>
@@ -26,7 +31,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -34,23 +39,23 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::ILoudnessEnhancerEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
+using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
+using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
+using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
+using ::android::hardware::audio::effect::CPP_VERSION::ILoudnessEnhancerEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect {
explicit LoudnessEnhancerEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -94,7 +99,7 @@
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::ILoudnessEnhancerEffect
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::ILoudnessEnhancerEffect
// follow.
Return<Result> setTargetGain(int32_t targetGainMb) override;
Return<void> getTargetGain(getTargetGain_cb _hidl_cb) override;
@@ -106,8 +111,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_LOUDNESSENHANCEREFFECT_H
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h b/audio/effect/all-versions/default/NoiseSuppressionEffect.cpp
similarity index 95%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h
rename to audio/effect/all-versions/default/NoiseSuppressionEffect.cpp
index f32399c..4756719 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h
+++ b/audio/effect/all-versions/default/NoiseSuppressionEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "NS_Effect_HAL"
+
+#include "NoiseSuppressionEffect.h"
#include <android/log.h>
@@ -24,7 +26,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
NoiseSuppressionEffect::NoiseSuppressionEffect(effect_handle_t handle)
@@ -44,7 +46,7 @@
halProperties->type = static_cast<uint32_t>(properties.type);
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> NoiseSuppressionEffect::init() {
return mEffect->init();
}
@@ -171,7 +173,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::INoiseSuppressionEffect
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::INoiseSuppressionEffect
// follow.
Return<Result> NoiseSuppressionEffect::setSuppressionLevel(INoiseSuppressionEffect::Level level) {
return mEffect->setParam(NS_PARAM_LEVEL, static_cast<int32_t>(level));
@@ -212,7 +214,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.h b/audio/effect/all-versions/default/NoiseSuppressionEffect.h
similarity index 77%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.h
rename to audio/effect/all-versions/default/NoiseSuppressionEffect.h
index c70d768..af62dd1 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.h
+++ b/audio/effect/all-versions/default/NoiseSuppressionEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_NOISESUPPRESSIONEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_NOISESUPPRESSIONEFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/INoiseSuppressionEffect.h)
+
+#include "Effect.h"
#include <system/audio_effects/effect_ns.h>
@@ -28,7 +33,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -36,23 +41,23 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::INoiseSuppressionEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
+using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
+using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
+using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
+using ::android::hardware::audio::effect::CPP_VERSION::INoiseSuppressionEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct NoiseSuppressionEffect : public INoiseSuppressionEffect {
explicit NoiseSuppressionEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -96,7 +101,7 @@
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::INoiseSuppressionEffect
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::INoiseSuppressionEffect
// follow.
Return<Result> setSuppressionLevel(INoiseSuppressionEffect::Level level) override;
Return<void> getSuppressionLevel(getSuppressionLevel_cb _hidl_cb) override;
@@ -118,8 +123,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_NOISESUPPRESSIONEFFECT_H
diff --git a/audio/effect/all-versions/OWNERS b/audio/effect/all-versions/default/OWNERS
similarity index 100%
rename from audio/effect/all-versions/OWNERS
rename to audio/effect/all-versions/default/OWNERS
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.impl.h b/audio/effect/all-versions/default/PresetReverbEffect.cpp
similarity index 93%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.impl.h
rename to audio/effect/all-versions/default/PresetReverbEffect.cpp
index eab68fb..97723f5 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.impl.h
+++ b/audio/effect/all-versions/default/PresetReverbEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "PresetReverb_HAL"
+
+#include "PresetReverbEffect.h"
#include <android/log.h>
#include <system/audio_effects/effect_presetreverb.h>
@@ -25,14 +27,14 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
PresetReverbEffect::PresetReverbEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {}
PresetReverbEffect::~PresetReverbEffect() {}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> PresetReverbEffect::init() {
return mEffect->init();
}
@@ -159,7 +161,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IPresetReverbEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IPresetReverbEffect follow.
Return<Result> PresetReverbEffect::setPreset(IPresetReverbEffect::Preset preset) {
return mEffect->setParam(REVERB_PARAM_PRESET, static_cast<t_reverb_presets>(preset));
}
@@ -172,7 +174,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.h b/audio/effect/all-versions/default/PresetReverbEffect.h
similarity index 75%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.h
rename to audio/effect/all-versions/default/PresetReverbEffect.h
index e5d77f0..aa864b0 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.h
+++ b/audio/effect/all-versions/default/PresetReverbEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_PRESETREVERBEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_PRESETREVERBEFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IPresetReverbEffect.h)
+
+#include "Effect.h"
#include <hidl/Status.h>
@@ -26,7 +31,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -34,23 +39,23 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IPresetReverbEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
+using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
+using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
+using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
+using ::android::hardware::audio::effect::CPP_VERSION::IPresetReverbEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct PresetReverbEffect : public IPresetReverbEffect {
explicit PresetReverbEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -94,7 +99,7 @@
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IPresetReverbEffect
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IPresetReverbEffect
// follow.
Return<Result> setPreset(IPresetReverbEffect::Preset preset) override;
Return<void> getPreset(getPreset_cb _hidl_cb) override;
@@ -106,8 +111,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_PRESETREVERBEFFECT_H
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.impl.h b/audio/effect/all-versions/default/VirtualizerEffect.cpp
similarity index 95%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.impl.h
rename to audio/effect/all-versions/default/VirtualizerEffect.cpp
index 23b09a89..4d597c7 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.impl.h
+++ b/audio/effect/all-versions/default/VirtualizerEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "Virtualizer_HAL"
+
+#include "VirtualizerEffect.h"
#include <memory.h>
@@ -27,7 +29,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
VirtualizerEffect::VirtualizerEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {}
@@ -44,7 +46,7 @@
}
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> VirtualizerEffect::init() {
return mEffect->init();
}
@@ -171,7 +173,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVirtualizerEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IVirtualizerEffect follow.
Return<bool> VirtualizerEffect::isStrengthSupported() {
bool halSupported = false;
mEffect->getParam(VIRTUALIZER_PARAM_STRENGTH_SUPPORTED, halSupported);
@@ -224,7 +226,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.h b/audio/effect/all-versions/default/VirtualizerEffect.h
similarity index 75%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.h
rename to audio/effect/all-versions/default/VirtualizerEffect.h
index 544db1e..87b53d6 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.h
+++ b/audio/effect/all-versions/default/VirtualizerEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_VIRTUALIZEREFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_VIRTUALIZEREFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IVirtualizerEffect.h)
+
+#include "Effect.h"
#include <hidl/Status.h>
@@ -26,7 +31,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -34,25 +39,25 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioChannelMask;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::implementation::AudioChannelBitfield;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVirtualizerEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask;
+using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
+using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
+using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
+using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioChannelBitfield;
+using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
+using ::android::hardware::audio::effect::CPP_VERSION::IVirtualizerEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct VirtualizerEffect : public IVirtualizerEffect {
explicit VirtualizerEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -96,7 +101,7 @@
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVirtualizerEffect
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IVirtualizerEffect
// follow.
Return<bool> isStrengthSupported() override;
Return<Result> setStrength(uint16_t strength) override;
@@ -116,8 +121,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_VIRTUALIZEREFFECT_H
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.impl.h b/audio/effect/all-versions/default/VisualizerEffect.cpp
similarity index 95%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.impl.h
rename to audio/effect/all-versions/default/VisualizerEffect.cpp
index 9f2195b..77bf46b 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.impl.h
+++ b/audio/effect/all-versions/default/VisualizerEffect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#define LOG_TAG "Visualizer_HAL"
+
+#include "VisualizerEffect.h"
#include <android/log.h>
#include <system/audio_effects/effect_visualizer.h>
@@ -25,7 +27,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
VisualizerEffect::VisualizerEffect(effect_handle_t handle)
@@ -33,7 +35,7 @@
VisualizerEffect::~VisualizerEffect() {}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> VisualizerEffect::init() {
return mEffect->init();
}
@@ -160,7 +162,7 @@
return mEffect->close();
}
-// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVisualizerEffect follow.
+// Methods from ::android::hardware::audio::effect::CPP_VERSION::IVisualizerEffect follow.
Return<Result> VisualizerEffect::setCaptureSize(uint16_t captureSize) {
Result retval = mEffect->setParam(VISUALIZER_PARAM_CAPTURE_SIZE, captureSize);
if (retval == Result::OK) {
@@ -247,7 +249,7 @@
}
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.h b/audio/effect/all-versions/default/VisualizerEffect.h
similarity index 77%
rename from audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.h
rename to audio/effect/all-versions/default/VisualizerEffect.h
index e207fc0..0a13a2b 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.h
+++ b/audio/effect/all-versions/default/VisualizerEffect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-#include <common/all-versions/IncludeGuard.h>
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_VISUALIZEREFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_VISUALIZEREFFECT_H
+
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IVisualizerEffect.h)
+
+#include "Effect.h"
#include <hidl/Status.h>
@@ -26,7 +31,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace AUDIO_HAL_VERSION {
+namespace CPP_VERSION {
namespace implementation {
using ::android::sp;
@@ -34,23 +39,23 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
-using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVisualizerEffect;
-using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
+using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
+using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
+using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
+using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
+using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
+using ::android::hardware::audio::effect::CPP_VERSION::IVisualizerEffect;
+using ::android::hardware::audio::effect::CPP_VERSION::Result;
struct VisualizerEffect : public IVisualizerEffect {
explicit VisualizerEffect(effect_handle_t handle);
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -94,7 +99,7 @@
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
- // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVisualizerEffect follow.
+ // Methods from ::android::hardware::audio::effect::CPP_VERSION::IVisualizerEffect follow.
Return<Result> setCaptureSize(uint16_t captureSize) override;
Return<void> getCaptureSize(getCaptureSize_cb _hidl_cb) override;
Return<Result> setScalingMode(IVisualizerEffect::ScalingMode scalingMode) override;
@@ -115,8 +120,10 @@
};
} // namespace implementation
-} // namespace AUDIO_HAL_VERSION
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_VISUALIZEREFFECT_H
diff --git a/audio/effect/2.0/vts/OWNERS b/audio/effect/all-versions/vts/OWNERS
similarity index 98%
rename from audio/effect/2.0/vts/OWNERS
rename to audio/effect/all-versions/vts/OWNERS
index 8711a9f..0ea4666 100644
--- a/audio/effect/2.0/vts/OWNERS
+++ b/audio/effect/all-versions/vts/OWNERS
@@ -2,4 +2,4 @@
krocard@google.com
mnaganov@google.com
yim@google.com
-zhuoyao@google.com
\ No newline at end of file
+zhuoyao@google.com
diff --git a/audio/effect/all-versions/vts/functional/Android.bp b/audio/effect/all-versions/vts/functional/Android.bp
new file mode 100644
index 0000000..a379d29
--- /dev/null
+++ b/audio/effect/all-versions/vts/functional/Android.bp
@@ -0,0 +1,73 @@
+//
+// Copyright (C) 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+cc_test {
+ name: "VtsHalAudioEffectV2_0TargetTest",
+ defaults: ["VtsHalTargetTestDefaults"],
+ srcs: [
+ "VtsHalAudioEffectTargetTest.cpp",
+ "ValidateAudioEffectsConfiguration.cpp"
+ ],
+ static_libs: [
+ "android.hardware.audio.common.test.utility",
+ "android.hardware.audio.common@2.0",
+ "android.hardware.audio.effect@2.0",
+ "android.hidl.allocator@1.0",
+ "android.hidl.memory@1.0",
+ "libeffectsconfig",
+ "libicuuc",
+ "libicuuc_stubdata",
+ "libxml2",
+ ],
+ header_libs: [
+ "android.hardware.audio.common.util@all-versions",
+ ],
+ test_suites: ["general-tests"],
+ cflags: [
+ "-DMAJOR_VERSION=2",
+ "-DMINOR_VERSION=0",
+ "-include common/all-versions/VersionMacro.h",
+ ]
+}
+
+cc_test {
+ name: "VtsHalAudioEffectV4_0TargetTest",
+ defaults: ["VtsHalTargetTestDefaults"],
+ srcs: [
+ "VtsHalAudioEffectTargetTest.cpp",
+ "ValidateAudioEffectsConfiguration.cpp"
+ ],
+ static_libs: [
+ "android.hardware.audio.common.test.utility",
+ "android.hardware.audio.common@4.0",
+ "android.hardware.audio.effect@4.0",
+ "android.hidl.allocator@1.0",
+ "android.hidl.memory@1.0",
+ "libeffectsconfig",
+ "libicuuc",
+ "libicuuc_stubdata",
+ "libxml2",
+ ],
+ header_libs: [
+ "android.hardware.audio.common.util@all-versions",
+ ],
+ test_suites: ["general-tests"],
+ cflags: [
+ "-DMAJOR_VERSION=4",
+ "-DMINOR_VERSION=0",
+ "-include common/all-versions/VersionMacro.h",
+ ]
+}
diff --git a/audio/effect/2.0/vts/functional/ValidateAudioEffectsConfiguration.cpp b/audio/effect/all-versions/vts/functional/ValidateAudioEffectsConfiguration.cpp
similarity index 83%
rename from audio/effect/2.0/vts/functional/ValidateAudioEffectsConfiguration.cpp
rename to audio/effect/all-versions/vts/functional/ValidateAudioEffectsConfiguration.cpp
index 040c93f..9f45ce2 100644
--- a/audio/effect/2.0/vts/functional/ValidateAudioEffectsConfiguration.cpp
+++ b/audio/effect/all-versions/vts/functional/ValidateAudioEffectsConfiguration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,15 +25,18 @@
#define QUOTE(x) #x
#define STRINGIFY(x) QUOTE(x)
-#define AUDIO_HAL_VERSION V2_0
-
TEST(CheckConfig, audioEffectsConfigurationValidation) {
RecordProperty("description",
"Verify that the effects configuration file is valid according to the schema");
using namespace android::effectsConfig;
std::vector<const char*> locations(std::begin(DEFAULT_LOCATIONS), std::end(DEFAULT_LOCATIONS));
- const char* xsd = "/data/local/tmp/audio_effects_conf_" STRINGIFY(AUDIO_HAL_VERSION) ".xsd";
+ const char* xsd = "/data/local/tmp/audio_effects_conf_" STRINGIFY(CPP_VERSION) ".xsd";
+#if MAJOR_VERSION == 2
// In V2, audio effect XML is not required. .conf is still allowed though deprecated
EXPECT_VALID_XML_MULTIPLE_LOCATIONS(DEFAULT_NAME, locations, xsd);
+#elif MAJOR_VERSION == 4
+ // Starting with V4, audio effect XML is required
+ EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS(DEFAULT_NAME, locations, xsd);
+#endif
}
diff --git a/audio/effect/2.0/vts/functional/VtsHalAudioEffectTargetTest.cpp b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
similarity index 93%
rename from audio/effect/2.0/vts/functional/VtsHalAudioEffectTargetTest.cpp
rename to audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
index 078e420..c248eae 100644
--- a/audio/effect/2.0/vts/functional/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,11 +18,11 @@
#include <android-base/logging.h>
#include <system/audio.h>
-#include <android/hardware/audio/effect/2.0/IEffect.h>
-#include <android/hardware/audio/effect/2.0/IEffectsFactory.h>
-#include <android/hardware/audio/effect/2.0/IEqualizerEffect.h>
-#include <android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h>
-#include <android/hardware/audio/effect/2.0/types.h>
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IEffect.h)
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IEffectsFactory.h)
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IEqualizerEffect.h)
+#include PATH(android/hardware/audio/effect/FILE_VERSION/ILoudnessEnhancerEffect.h)
+#include PATH(android/hardware/audio/effect/FILE_VERSION/types.h)
#include <android/hidl/allocator/1.0/IAllocator.h>
#include <android/hidl/memory/1.0/IMemory.h>
@@ -39,23 +39,23 @@
using android::hardware::MQDescriptorSync;
using android::hardware::Return;
using android::hardware::Void;
+using android::hardware::audio::common::CPP_VERSION::AudioDevice;
+using android::hardware::audio::common::CPP_VERSION::AudioHandleConsts;
+using android::hardware::audio::common::CPP_VERSION::AudioMode;
+using android::hardware::audio::common::CPP_VERSION::AudioSource;
+using android::hardware::audio::common::CPP_VERSION::Uuid;
using android::hardware::audio::common::utils::mkEnumBitfield;
-using android::hardware::audio::common::V2_0::AudioDevice;
-using android::hardware::audio::common::V2_0::AudioHandleConsts;
-using android::hardware::audio::common::V2_0::AudioMode;
-using android::hardware::audio::common::V2_0::AudioSource;
-using android::hardware::audio::common::V2_0::Uuid;
-using android::hardware::audio::effect::V2_0::AudioBuffer;
-using android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig;
-using android::hardware::audio::effect::V2_0::EffectBufferConfig;
-using android::hardware::audio::effect::V2_0::EffectConfig;
-using android::hardware::audio::effect::V2_0::EffectDescriptor;
-using android::hardware::audio::effect::V2_0::EffectOffloadParameter;
-using android::hardware::audio::effect::V2_0::IEffect;
-using android::hardware::audio::effect::V2_0::IEffectsFactory;
-using android::hardware::audio::effect::V2_0::IEqualizerEffect;
-using android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect;
-using android::hardware::audio::effect::V2_0::Result;
+using android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
+using android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
+using android::hardware::audio::effect::CPP_VERSION::EffectBufferConfig;
+using android::hardware::audio::effect::CPP_VERSION::EffectConfig;
+using android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
+using android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
+using android::hardware::audio::effect::CPP_VERSION::IEffect;
+using android::hardware::audio::effect::CPP_VERSION::IEffectsFactory;
+using android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect;
+using android::hardware::audio::effect::CPP_VERSION::ILoudnessEnhancerEffect;
+using android::hardware::audio::effect::CPP_VERSION::Result;
using android::hidl::allocator::V1_0::IAllocator;
using android::hidl::memory::V1_0::IMemory;
@@ -162,7 +162,11 @@
TEST_F(AudioEffectsFactoryHidlTest, DebugDumpInvalidArgument) {
description("Verify that debugDump doesn't crash on invalid arguments");
+#if MAJOR_VERSION == 2
Return<void> ret = effectsFactory->debugDump(hidl_handle());
+#elif MAJOR_VERSION == 4
+ Return<void> ret = effectsFactory->debug(hidl_handle(), {});
+#endif
ASSERT_TRUE(ret.isOk());
}
@@ -338,7 +342,7 @@
namespace hardware {
namespace audio {
namespace effect {
-namespace V2_0 {
+namespace CPP_VERSION {
inline bool operator==(const AudioBuffer& lhs, const AudioBuffer& rhs) {
return lhs.id == rhs.id && lhs.frameCount == rhs.frameCount && lhs.data.handle() == nullptr &&
rhs.data.handle() == nullptr;
@@ -353,7 +357,7 @@
inline bool operator==(const EffectConfig& lhs, const EffectConfig& rhs) {
return lhs.inputCfg == rhs.inputCfg && lhs.outputCfg == rhs.outputCfg;
}
-} // namespace V2_0
+} // namespace CPP_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
@@ -737,7 +741,8 @@
description(
"Verify that setting band levels and presets works via Get / "
"SetAllProperties for Equalizer effect");
- using AllProperties = android::hardware::audio::effect::V2_0::IEqualizerEffect::AllProperties;
+ using AllProperties =
+ android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect::AllProperties;
uint16_t numBands = 0;
getNumBands(&numBands);
ASSERT_GT(numBands, 0);