Offline Charging :- When charger is connected to switched off device, it boots the device into offline charging mode and charging bootanimation comes. System is triggered into normal boot by holding the power button.
But am trying to build a kiosk device using Redmi 4A and cannot have user interaction. Thus need to override this offline charging so that device automatically boots into normal mode when connected to charger.
DEVICE IS ROOTED
I have followed all the methods suggested throughout the web --
The link in the last point, provides several options. I found this in my init.rc file -->
# Healthd can trigger a full boot from charger mode by signaling this
# property when the power button is held.
on property:sys.boot_from_charger_mode=1
class_stop charger
trigger late-init
...
...
on charger
class_start charger
As suggested, I modified the on charger trigger to contain the same code used to boot in normal mode when power button is held -->
on charger
class_start charger
class_stop charger
trigger late_init
This leads to bootloop i.e. device gets stuck on start screen and doesn't enter into normal boot. Couldn't find out the reason for same.
Tried increasing the log level 8 of init and checked adb shell dmesg, but no sign of where booting crashes.
Can anybody suggest remedy or any other alternative to disable offline booting.