I'm Developing an Android Application where it requireds 3 things:-
You Must know :- My phone is Moto E (rooted) and want 2nd step to be done. Tried some codes but that does not work on moto E. When Connected with USB it gives 2 as response and when connected with Wall socket charger it says 1
Any help will be Appreciated
P.S :- Auto Boot working with USB cable connected with Laptop but not with Socket Charger
Update-1: 1- Found fastboot oem off-mode-charge 0
working with Nexus 7 but not on Moto e.
2- Moto e boots when connected to Router (USB Dongle Port)
At last I got the solution, you can achieve this by deleting system/bin/charge_only_mode
file. Please do that at your own risk and before deleting have backup of that file. I got the desired result that was boot when its connected to wall charger and now its working fine.
All the best!
Moto e4 and Pixel 2 XL:
Get your device into the bootloader (fastboot) and run the following command from a computer connected over USB with Android Tools:
fastboot oem off-mode-charge 0
I was able to get it to work by updating the init.rc
file
I found the on charger
trigger and added the following lines below it:
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
The entire trigger block ends up looking like this
on charger
class_start charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
You then need to repack and flash the boot image created after the updates.
Connect the device over USB
Power on device and get to bootloader mode
adb reboot bootloader
To flash boot image execute the following command while in fastboot
fastboot flash boot new-boot.img
Note: This fix will cause the device to reboot when its plugged in even when shutting it off using the power button or software shutdown.
Source: https://forum.xda-developers.com/showthread.php?p=77766638#post77766638
You can see the commit that contains these changes for my project here:
https://github.com/darran-kelinske-fivestars/mkbootimg_tools/commit/c8633a2ec2e1924272fd16a8ed7fa7414bb65544#diff-d0007d763b44198f7c22e2c19609d5bbR606
I also tried replacing charge_only_mode with a sh script that rebooted the phone but only got a red circle with the M (on a Motorola Bionic). Changing the script to the below got it working...Now I get the red circle with the M for a few seconds, then a blank screen, the another red circle with the M, and it boots on up.
#!/system/bin/sh
su -c "/system/bin/reboot -n outofcharge"
On my device Lenovo K7000-Plus, the file need to be modified is kpoc_charger
located at /system/bin
.
Ipod file not working on my phone which using Android 6.0 ROM, but kpoc_charger works pefectly.
Regards
Hadi
For Lenovo A2010 phone,following worked:
Now edit the original file kpoc_charger using total-commander, replace all lines with following code:
#!/system/bin/sh
/system/bin/reboot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With