- Change the battery charging animation with a shell script which executes the reboot command
- Use fastboot oem command (fastboot oem off-mode-charge enable/disable or similar command which is oem depended)
- Modify the boot image by overriding the on charger event(s) so to "continue" booting or force the device to reboot
I started with the first solution: I replaced the /system/bin/lpm file with
#!/system/bin/sh su /system/bin/reboot
The second solution was not applicable to the Samsung Galaxy S7 since the fastboot does not exist.
The third solution did not produce also the desired behavior. I got the boot image using dd and unpacked it using the unpackimg tool. I modified the file init.rc by changing the on charger event to:
on charger class_start charger class_stop charger trigger late-init
on charger class_start charger class_stop charger start boot-on-charge service boot-on-charge /system/bin/reboot class charger user root oneshot
on charger class_start charger setprop sys.boot_from_charger_mode 1
Has anyone tried the above solutions (or a different approach) on Samsung Galaxy S7 successfully?