# For intelligence service
# on  -> mount(ok)    -> on
# off -> write_zeroes -> remove -> rm(ok) -> disable
# on  -> mount(fail)  -> remove -> rm(ok) -> disable

service storage_intelligence /vendor/bin/storage_intelligence.sh
    user root
    disabled
    oneshot

on boot && property:persist.vendor.intelligence=on
    mkdir /data/vendor/intelligence 0770 vendor_intelligence vendor_intelligence
    mount f2fs loop@/dev/block/by-name/userdata_exp.ai /data/vendor/intelligence rw
    restorecon_recursive /data/vendor/intelligence
    mount f2fs /data/vendor/intelligence /data/vendor/intelligence remount ro
    start storage_intelligence

on boot && property:persist.vendor.intelligence=off
    start storage_intelligence

on property:persist.vendor.intelligence=remove
    rm /data/userdata_exp.ai
    rmdir /data/vendor/intelligence
    setprop persist.vendor.intelligence disable
