1function avatar {
2  # avatar script.
3  _AVATAR="${ANDROID_BUILD_TOP}/packages/modules/Bluetooth/android/pandora/test/avatar.sh"
4
5  if ! command -v python3 &> /dev/null; then
6    echo "python3: command not found" 1>&2
7    echo "  on linux: 'sudo apt install python3 python3-pip python3-venv'" 1>&2
8    return 1
9  fi
10
11  # only compile when needed.
12  if [[ "$1" == "run" ]]; then
13    m avatar avatar.sh PandoraServer tradefed tradefed-test-framework tradefed-core tradefed.sh || return 1
14    _AVATAR="avatar.sh"
15  fi
16
17  # run avatar script.
18  "${_AVATAR}" "$@"
19}
20