diff options
author | Mikhail Naganov <mnaganov@google.com> | 2020-07-22 22:58:25 +0000 |
---|---|---|
committer | Jakub Pawlowski <jpawlowski@google.com> | 2020-10-27 15:24:36 +0100 |
commit | 3b1172dfe407c87109300bad97acca298cf5ea79 (patch) | |
tree | 7a6c0d2e5f56fd15ae7f2300641357511af08cbd /audio | |
parent | 2d82c11b0f68acda452f7fa9bc54a59bf9c19144 (diff) | |
download | platform_hardware_interfaces-3b1172dfe407c87109300bad97acca298cf5ea79.tar.gz platform_hardware_interfaces-3b1172dfe407c87109300bad97acca298cf5ea79.tar.bz2 platform_hardware_interfaces-3b1172dfe407c87109300bad97acca298cf5ea79.zip |
Audio: Update and fix copyHAL script
Make necessary updates and fixes to produce HAL V7 and VTS.
Bug: 142480271
Test: audio/common/all-versions/copyHAL.sh 6.0 7.0 &&
atest --rebuild-module-info -b VtsHalAudioV7_0TargetTest &&
m
Change-Id: I5bc2344dae611fbf7e3e0fef185deee999c4aefa
Merged-In: I5bc2344dae611fbf7e3e0fef185deee999c4aefa
Diffstat (limited to 'audio')
-rwxr-xr-x | audio/common/all-versions/copyHAL.sh | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/audio/common/all-versions/copyHAL.sh b/audio/common/all-versions/copyHAL.sh index 0a32a51275..23e057a6f7 100755 --- a/audio/common/all-versions/copyHAL.sh +++ b/audio/common/all-versions/copyHAL.sh @@ -16,6 +16,7 @@ fi readonly HAL_DIRECTORY=hardware/interfaces/audio readonly HAL_VTS_DIRECTORY=core/all-versions/vts/functional readonly HAL_VTS_FILE=AudioPrimaryHidlHalTest.cpp +readonly HAL_EFFECT_VTS_DIRECTORY=effect/all-versions/vts/functional readonly HAL_SERVICE_DIRECTORY=common/all-versions/default/service/ readonly HAL_SERVICE_CPP=service.cpp @@ -25,7 +26,7 @@ readonly IMPL_FACTORYHAL=FactoryHalHidl.cpp readonly VTS_DIRECTORY=test/vts-testcase/hal/audio readonly VTS_LIST=test/vts/tools/build/tasks/list/vts_test_lib_hidl_package_list.mk -readonly WATCHDOG=frameworks/base/services/core/java/com/android/server/Watchdog.cpp +readonly WATCHDOG=frameworks/base/services/core/java/com/android/server/Watchdog.java readonly DUMP_UTILS=frameworks/native/libs/dumputils/dump_utils.cpp readonly GSI_CURRENT=build/make/target/product/gsi/current.txt @@ -45,6 +46,9 @@ readonly NEW_VERSION_REGEX="${NEW_MAJOR_VERSION}[._]${NEW_MINOR_VERSION}" readonly BASE_VERSION_ESCAPE="${BASE_MAJOR_VERSION}\.${BASE_MINOR_VERSION}" readonly BASE_VERSION_UNDERSCORE="${BASE_MAJOR_VERSION}_${BASE_MINOR_VERSION}" readonly NEW_VERSION_UNDERSCORE="${NEW_MAJOR_VERSION}_${NEW_MINOR_VERSION}" + +readonly HAL_VTS_CONFIG_FILE_GLOB="*Audio*V${BASE_VERSION_UNDERSCORE}*Test.xml" + updateVersion() { if [ $1 == "-e" ]; then local -r REGEX="$2"; shift 2 @@ -71,6 +75,10 @@ updateAudioVersion() { updateVersion -e "audio.*$BASE_VERSION_REGEX" "$@" } +updateAudioVtsTargetVersion() { + updateVersion -e "Audio.*V$BASE_VERSION_REGEX" "$@" +} + updateLicenceDates() { # Update date on the 2 first lines sed -i "1,2 s/20[0-9][0-9]/$(date +"%Y")/g" "$@" @@ -101,9 +109,16 @@ createHALVersion() { cp -Tar $DIR/$BASE_VERSION $DIR/$NEW_VERSION COPY+=" $DIR/$NEW_VERSION" done + local COPY_FILES_TO= + for FILE_FROM in $(find . -type f -name "$HAL_VTS_CONFIG_FILE_GLOB"); do + local FILE_TO=${FILE_FROM/$BASE_VERSION_UNDERSCORE/$NEW_VERSION_UNDERSCORE} + cp "$FILE_FROM" "$FILE_TO" + COPY_FILES_TO+=" $FILE_TO" + done echo "Replacing $BASE_VERSION by $NEW_VERSION in the copied files" updateVersion $(find $COPY -type f) + updateVersion $COPY_FILES_TO updateLicenceDates $(find $COPY -type f) echo "Update implementation and VTS generic code" @@ -156,18 +171,12 @@ createFrameworkAdapter() { echo "Now creating the framework adapter version" runIfNeeded $FWK_DIRECTORY createFrameworkAdapter -createVTSXML() { - cp -Tar V$BASE_VERSION_UNDERSCORE V$NEW_VERSION_UNDERSCORE - cp -Tar effect/{V$BASE_VERSION_UNDERSCORE,V$NEW_VERSION_UNDERSCORE} - local -r FILES=$(find {.,effect}/V$NEW_VERSION_UNDERSCORE -type f) - updateVersion $FILES - updateLicenceDates $FILES -} -echo "Now update VTS XML" -runIfNeeded $VTS_DIRECTORY createVTSXML - echo "Now register new VTS" +PREV_MODIFIED="$MODIFIED" runIfNeeded $(dirname $VTS_LIST) updateAudioVersion -v original_before=1 $(basename $VTS_LIST) +if [[ "$PREV_MODIFIED" != "$MODIFIED" ]]; then + updateAudioVtsTargetVersion -v original_after=1 $(basename $VTS_LIST) +fi echo "Now update watchdog" runIfNeeded $(dirname $WATCHDOG) updateAudioVersion -v original_before=1 $(basename $WATCHDOG) |