#!/system/bin/sh
# Puts the installed thermal HAL back without a reboot.
[ -n "$TH_NS" ] || exec nsenter -t 1 -m -- env TH_NS=1 sh "$0" "$@"
# Unbind first (lazily: the running HAL keeps the file busy), then restart into the installed one.
umount -l /vendor/bin/hw/android.hardware.thermal-service.qti
stop vendor.thermal-hal
sleep 1
start vendor.thermal-hal
echo "service: $(getprop init.svc.vendor.thermal-hal)"
