Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Android device boot when power is plugged in?

I need to use this for a Samsung Tablet.

Usually if the device is switched-off and the USB cable is being connected the display will wake up for some seconds showing an animated battery. Instead I want to let it boot.

I suspect this is close to the metal. Where do I have to make a modification? In the kernel, in the Android platform, or is this hidden in some proprietary code of the manufacturer?

like image 878
user506290 Avatar asked Nov 12 '10 21:11

user506290


People also ask

How do I get my Android phone to turn on automatically?

Use the Built-In Feature Simple go to Settings>Addtional Settings and select Automatic On/Off. Select the time for automatic power off and power on. Your smartphone will turn the power off and back on at the scheduled time. Remember, this setting can also be in the battery or power management settings of your device.

Can you boot Android without battery?

Because smart phones pull in the required amount of power to function, you can directly plug the device into a power source, with, or without a battery in it. This is also a way to test to see if your phone still works after being exposed and dried off from water.

Why isn't my phone turning on when I plug it in?

Charge the Battery Try plugging your phone into a charger—if the battery is truly drained, it won't necessarily light up right away. Try leaving it plugged in for 15 to 30 minutes or so before turning it on. If that doesn't work, you could also have a damaged charger. Try a different cable, power bank, and wall outlet.


2 Answers

A member on XDA has posted a solution for this which seems to work on some Samsung devices.

The idea is to replace the script for the battery icon (which will appear of course as soon as the device is plugged in) with a custom script that will boot the phone. To make this work locate /system/bin/playlpm. Rename the old playlpm to playlpm.bak and replace it with the following script:

#!/system/bin/sh
/system/bin/reboot

For more information read the thread on XDA

like image 173
kingarold Avatar answered Sep 29 '22 20:09

kingarold


I have a rooted Samsung S4 mini. The following steps worked for me:

  1. mount -o remount,rw /system
  2. mv /system/bin/lpm /system/bin/lpm.orig
  3. create /system/bin/lpm as follows:

    #!/system/bin/sh
    /system/bin/lpm.orig &
    while [ true ]; do
      sleep 1
      ps | grep lpm.orig && sleep 3 && /system/bin/reboot
    done
    
  4. chown root.shell /system/bin/lpm

like image 44
Thorsten Avatar answered Sep 29 '22 20:09

Thorsten