platform_hardware_interfaces/update-base-files.sh
Mikhail Naganov a5273c760c Make audio*-base.h files autogenerated again
Major change: audio-base.h is generated from "core" types.hal,
new file audio_common-base.h is generated from "common" types.hal.

In order to be able to add system-only constants to generated
enums, the latter are made anonymous, values got "HAL_" prefix.
Then in system/audio.h a full enum is constructed.

Removed audio_drain_type_t from exported, as it belongs to
libhardware only.

Added missing enums that were introduced at the system side
only in Android R.

Bug: 122858783
Test: m
Change-Id: I8c017912395a03beacea077fd562fae2329ad975
2020-10-26 20:15:17 +00:00

52 lines
1.8 KiB
Bash
Executable file

#!/bin/bash
if [ ! -d $ANDROID_BUILD_TOP/hardware/interfaces ] ; then
echo "Where is hardware/interfaces?";
exit 1;
fi
if [ ! -d $ANDROID_BUILD_TOP/system/libhidl/transport ] ; then
echo "Where is system/libhidl/transport?";
exit 1;
fi
echo "WARNING: This script changes files in many places."
# These files only exist to facilitate the easy transition to hidl.
options="-Lexport-header \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport"
# hardware/libhardware
hidl-gen $options \
-o $ANDROID_BUILD_TOP/hardware/libhardware/include/hardware/sensors-base.h \
android.hardware.sensors@1.0
hidl-gen $options \
-o $ANDROID_BUILD_TOP/hardware/libhardware/include/hardware/nfc-base.h \
android.hardware.nfc@1.0
hidl-gen $options \
-o $ANDROID_BUILD_TOP/hardware/libhardware/include/hardware/gnss-base.h \
android.hardware.gnss@1.0
# system/core
hidl-gen $options \
-o $ANDROID_BUILD_TOP/system/core/include/system/graphics-base-v1.0.h \
android.hardware.graphics.common@1.0
hidl-gen $options \
-o $ANDROID_BUILD_TOP/system/core/include/system/graphics-base-v1.1.h \
android.hardware.graphics.common@1.1
hidl-gen $options \
-o $ANDROID_BUILD_TOP/system/core/include/system/graphics-base-v1.2.h \
android.hardware.graphics.common@1.2
# system/media
hidl-gen $options \
-o $ANDROID_BUILD_TOP/system/media/audio/include/system/audio_common-base.h \
android.hardware.audio.common@7.0
hidl-gen $options \
-o $ANDROID_BUILD_TOP/system/media/audio/include/system/audio-base.h \
android.hardware.audio@7.0
hidl-gen $options \
-o $ANDROID_BUILD_TOP/system/media/audio/include/system/audio_effect-base.h \
android.hardware.audio.effect@7.0