#!/usr/bin/env bash
set -euo pipefail

out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m android.hardware.rebootescrow -parameter frozen -set-bool false hardware/interfaces/rebootescrow/aidl/Android.bp
mkdir -p hardware/interfaces/rebootescrow/aidl/aidl_api/android.hardware.rebootescrow/current
rsync --recursive --update --delete-before out_adevtool_deps/soong/.intermediates/hardware/interfaces/rebootescrow/aidl/android.hardware.rebootescrow_interface/dump/* hardware/interfaces/rebootescrow/aidl/aidl_api/android.hardware.rebootescrow/current
out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m android.hardware.rebootescrow -parameter versions -remove-property hardware/interfaces/rebootescrow/aidl/Android.bp
out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m android.hardware.rebootescrow -parameter versions_with_info -add-literal '{version: "1", imports: []}'  hardware/interfaces/rebootescrow/aidl/Android.bp && out_adevtool_deps/host/linux-x86/bin/bpmodify -w -m android.hardware.rebootescrow -parameter frozen -set-bool true hardware/interfaces/rebootescrow/aidl/Android.bp
