Current SE Boolean is not persistent after reboot which means the booleans will be reverted back to the default value after reboot. I implement the persist_sebool feature to support the persistent sebooleans. After reboot, the value of booleans will be as the same as the ones before reboot.
The implementation distributes to two parts. First part is the booleans.c in which I write boolean value to user space (not only /sys/fs/selinux/booleans). Second part is in system/core. I implement a new tool which write the userspace value back to the sebooleans (in /sys/fs/selinux/booleans) when the phone is booting. The tool is set as a service in class main inside init.rc.
By making it a separate service, the booleans won't be restored until at some random point during startup.
Better to directly integrate into policy loading logic in libselinux/src/android.c so that they are set immediately from policy load onward.