This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.
For more details please refer to the link below,
<add g3 doc link>
Bug: 304529413
Test: N/A
Change-Id: I3322344f595f974f730dc824af0110388076d838
A change is being made so that sandboxed genrules need to add a
dependency on the targets of the symlinks they use.
In this case, the symlink isn't necessary, and we can just depend
on the audio_effects_conf_V2_0 genrule instead.
Bug: 307824623
Test: m audio_effects_conf_V4_0
Change-Id: I6ddaa81e08d7c4a9c29412b11a08f1d6b88689b5
HIDL libs are not necessarily part of VNDK now. Because some are
used by VNDK libs, they are still VNDK. But rest are now just
vendor-available.
.hidl_for_test files are also removed because they are used to exclude
test-purpose hidl libs from VNDK libs.
Instead, .hidl_for_system_ext files are added to tests/lazy to
distinguish them from others which are installed /system.
Bug: 143933769
Test: update-makefiles.sh && m com.android.vndk.current
Merged-In: Ia81312dda340b6b5cbdd7a3c21e1d323bda39a4a
Change-Id: Ia81312dda340b6b5cbdd7a3c21e1d323bda39a4a
(cherry picked from commit b0907a6bb8)
Convert VtsHalAudioEffectV*_0TargetTest to be parameterized test
and add it to vts-core
Bug: 142397658
Bug: 146104851
Bug: 146015418
Test: $atest VtsHalAudioEffectV2_0TargetTest
$atest VtsHalAudioEffectV4_0TargetTest
$atest VtsHalAudioEffectV5_0TargetTest
$atest VtsHalAudioEffectV6_0TargetTest
Change-Id: I3e9297f7c0a0453b04721f6af8998a18043f5815
hidl-generated makefiles are now generated such that bpfmt(file) == file.
Bug: 67417008
Test: enable bpfmt hook
Change-Id: I1f69d292bc23a7cc293a66110cb02d597e1019ad
libxml2 now depends on libandroidicu.
Add the same dependency into the VTS.
TODO: b/121468463 to remove ICU from VtsHalAudio
Bug: 117094880
Test: m checkbuild
Merged-In: I105e7ad1517ecf8780adfb730650e1ad82f65857
Change-Id: I105e7ad1517ecf8780adfb730650e1ad82f65857
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>
It was thought that the V2 VTS were not going to be supported after V4
VTS were created. Thus a large portion of the code was copy paste and
modified.
That assumption ended up wrong as a lot of OEM reported bugs that needed
to be fixed in both versions.
As a result align the code of both version VTS as much as possible.
The code will be merged in a follow up patch.
Bug: 118203066
Test: compile
Change-Id: I994232db237b5d7c52e7d796f199ab3c6eec21f4
Signed-off-by: Kevin Rocard <krocard@google.com>
Rename files so that, if they are in a X.0 folder, their name does
not contain that version number. That allows for easier copy paste
when creating a new version.
Conversion.h was included from the all-versions instead of the X.0
headers. This in incoherent with the other headers.
Add VersionMacro.h that will be used in the follow up patch.
Also remove shim from VNDK as only stable ABI&API libraries should be
part of it.
Test: Compile
Bug: 118203066
Change-Id: I9cd77b3df5ccede5ae51c3cc94fab5939c51d9ef
Signed-off-by: Kevin Rocard <krocard@google.com>
That will permit minimal change on future refactors.
Bug: 118203066
Test: compile
Change-Id: Ibed095d3821e2f7b6177faa07775bde9821459c7
Signed-off-by: Kevin Rocard <krocard@google.com>
VTS tests can only depend on NDK shared libraries,
they are pushed and run on older desert version.
In theory the VTS tests should be built against the NDK,
but this is not possible due to all the system dependencies.
Bug: 78871270
Test: compile
Change-Id: I48fbffd0316efc151917071c54aa19e533c615df
Signed-off-by: Kevin Rocard <krocard@google.com>
This was breaking Treble interface consistency test.
Bug: 77853088
Test: play music effect work
Change-Id: Ieb54f9c154e346286da353d0c3cdc770574c9bfe
Signed-off-by: Kevin Rocard <krocard@google.com>
The XML format has not changed. Symlink the V4 XSD to the V2.
Bug: 76165942
Bug: 38184704
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioEffectV4_0Target
Change-Id: I25a61c125c461c6c5b89d53142dcf887d6c94347
Signed-off-by: Kevin Rocard <krocard@google.com>
Because VTS must no be modified for old API version (except bug fixes),
as that could break retrocompatiblity.
As a result, a full copy is made. This commit is only:
$ cp -r core/2.0/vts/ core/4.0/vts
$ cp -r effect/2.0/vts/ effect/4.0/vts
With a V2 replaced by V4 test target name to avoid conflict.
Bug: 38184704
Test: Compile
Change-Id: Iddf9e7a9d42bfe84cf067a08d249a9cc0e6b7241
Signed-off-by: Kevin Rocard <krocard@google.com>
All the new files added are a copy of the 2.0 ones, with just the
version 2 that was changed to 4.
Due to the rollback on the retrocompatiblity breakage,
the split of implementation is not strictly needed any more.
This makes the current split in .impl.h and double include
unnecessary complicated.
This will need to be factorized in a future patch.
Bug: 38184704
Test: compile
Change-Id: If412eb55ebf6afc773593547af9395a09b6825c2
Merged-In: If412eb55ebf6afc773593547af9395a09b6825c2
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
Run update-makefiles.sh to create all HAL makefiles.
Test: update-makefiles.sh
Bug: 38184704
Change-Id: I2532c4b9d1f0f6252ceaffbfb0c5d0a615400c72
Signed-off-by: Kevin Rocard <krocard@google.com>
Remove unnecessary Result typedef.
Make bufferSizeFrames and burstSizeFrames unsigned
as they should not be negative.
Remove legacy AudioInterleave.
Remove implicit callflow annotation.
Make EffectConfigParameters a bitfield.
Bug: 38184704
Test: hardware/interfaces/update-makefiles.py
Change-Id: I33e6f7869d20ca0cad4123f32347754e5a514caa
Signed-off-by: Kevin Rocard <krocard@google.com>
The debugDump function was deprecated by the introduction of the
debug method in the IBase.
AudioMode CURRENT and INVALID should not be passed to the
vendor.
Bug: 38184704
Test: none
Change-Id: I0e14c71ce7216524587a6ba28cae0cdb821bae23
Signed-off-by: Kevin Rocard <krocard@google.com>
The audio HAL has lots of enums were each value is a specific bit
pattern (usually a single bit) and are expected to be used as a
combination of value (kind of like a bitfield).
Nevertheless the 2.0 methods only had the enums themselves in their
signatures which leads the HIDL API checkers to warn that invalid values
were passed.
Currently, there are no way to express a value which is a combination
of enum values. The closest thing is the bitfield type.
Thus transition all enums combination to bitfield.
Note that AudioDevice as NOT been transition systematically
as both the enums and the combination are meaningful:
- the enum is one device
- the combination is a list of device.
Test: none
Bug: 38184704
Change-Id: I155cf7bc5d88fc5cf8954903d55aa8d7ca458a4b
Signed-off-by: Kevin Rocard <krocard@google.com>
Add missing documentation, especially for failure cases
and methods that are optional.
Add missing operation status for testability.
Add format for getSupported* methods as they could not
be implemented in 2.0 for multi-format stream (HDMI).
Test: compile
Bug: 38184704
Change-Id: I14ee5e02ef70a82df6de732f88b065810e9b032f
Signed-off-by: Kevin Rocard <krocard@google.com>
That will ease review of the changes.
The only changes are:
- replace all @2.0 by 4.0
$ sed -i 's/@2\.0/@4\.0/g' */4.0/*.hal
- replace all licence 2016 by 2018
$ sed -i 's/2016/2018/g' */4.0/*.hal
Moving the .hal in a subfolder forces the package name and the
namespace to change.
This mean that the audio HAL 2.0 and 4.0 will not be consider
different version of the same HAL but two different HALs.
As a result to minimize code change due to tight deadline,
keep the 4.0 core in the audio folder.
Bug: 38184704
Test: hardware/interfaces/update-makefiles.sh
Change-Id: I7c7a826270c9933091f037b795806787e1284583
Signed-off-by: Kevin Rocard <krocard@google.com>