Evan Grant
Evan Grant

Reputation: 13

Auto boot from offline charging when charged on Sony Xperia or disable offline charging

I'm trying to auto boot my Sony Xperia SP when the battery is done charging. I've tried all the various solutions for Samsung and others devices none seem to work.

I've managed to locate the png files that are loaded when charging, I cannot however find the script that calls them. I've tried searching all the files in the system folder for any reference to the png file names or similar, to no avail.

I'm aware that offline charging wasn't always supported by custom roms and wonder if one solution might be to disable offline charging?

I've spent many hours searching the forums and can't find anything that works. I'd be super grateful for anyone who can help. Here's some of the other things I've tried:

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

Auto boot when wall charger is plugged

How to auto boot a rooted android device on charging [code req]

https://arduandro.wordpress.com/2014/07/03/autobootstart-android-when-charger-is-connected/

Upvotes: 1

Views: 5011

Answers (1)

jaco777
jaco777

Reputation: 31

On my Sony Xperia J ST26i, Android 4.1.2, kernel 3.4.0, work this:

  • first backup data from phone, phone must be rooted,
  • go to "/system/bin/" and find file "battery_charging", oryginal file have size aprox 9kB,
  • backup this file, check permissions this copy file after backup with oryginal file, sometimes permissions is changing in copy file,
  • edit oryginal file, delete all data inside,
  • put in file:

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

    in hex,

    23 21 2F 73 79 73 74 65 6D 2F 62 69 6E 2F 73 68 0D 0A 73 75 0D 0A 2F 73 79 73 74 65 6D 2F 62 69 6E 2F 72 65 62 6F 6F 74
    
  • save changes, again check permissions, must be -rwxr-xr-x, 0:root, 2000:shell, exactly the same as the original file,

  • reboot phone, next turn off phone, connect charger, then phone start :-).

If file "battery_charging" not exist, then try find other file with battery, charge in name, and in file find text like :

/sys/devices/platform/msm-battery/isPowerKeyPressed /sys/devices/platform/msm-battery/isChargerConnected /sys/devices/platform/msm-battery/isEnterPowerOffCharging /sys/bus/i2c/devices/1-0055/isBatteryVaild /sys/bus/i2c/devices/1-0055/isGaugeReady /sys/devices/platform/msm-battery/isEnableCharging /sys/devices/platform/msm-battery/isBatteryFull /sys/bus/i2c/devices/1-0055/rsoc /sys/devices/platform/msm-battery/power_supply/battery/voltage_now %d /sys/class/graphics/fb0/display_battery batt_chg

or

/sys/class/power_supply/battery/batt_charging_source we cannot read CABLE_STATUS, but it's ok /sys/class/power_supply/battery/status /sys/class/power_supply/battery/health Over voltage /sys/class/leds/lcd-backlight/brightness LCD brightness=%d /sys/class/power_supply/battery/capacity charging mode : %d /system/media/battery_charging_%d.qmg /system/media/battery_charging_100.qmg /system/media/chargingwarning.qmg /system/media/battery_error.qmg /system/media/battery_batteryerror.qmg

Upvotes: 1

Related Questions