Disabling offline charging in Redmi 4A - Rolex for kiosk mode

561 views
Skip to first unread message

Parth Sharma

unread,
Mar 14, 2018, 5:22:48 PM3/14/18
to android-platform

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 --

  1. 1. fastboot oem off-mode-charge 0 -- NOT WORKING
  2. 2. /system/bin/lpm , /system/bin/charge_only_mode, /system/bin/kpoc_charger, /system/bin/chargemon or any other related file -- NOT PRESENT
  3. 3. https://appdictive.dk/blog/android/how-to/2017/04/20/disabeling_offline_charge_on_android/ -- tried this tutorial, but device gets stuck in bootloop.

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.

Reply all
Reply to author
Forward
0 new messages