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

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