By AsTeR

2011-10-26 07:10:23 8 Comments

I'm using my Samsung Galaxy S2 for development so I regularly plug it while it's not fully charged, and my phone starts charging over USB. I think this (charging while in use) can affect battery life (is that correct)? Is there any way to avoid charging while the phone is on and connected via USB?


@t0mm13b 2013-07-26 12:43:00

This is very dependent on the battery driver found in the kernel for said device.

Unlike Galaxy S 2, that uses the TI battery driver which does not have that capability to be able to write out the value to the /sys/module/msm_battery/parameters/usb_chg_enable file.

For the MSM7x27 line of chipsets, Qualcomm to you and me, such as MSM7227 or MSM7627, for example, Europa (Galaxy 5), Zte Blade, as they use the generic MSM battery driver, which was rather easy to work with.

I have the open sourced project hosted on Github that does this exactly that, by selectively activating the charge or using it as ordinary usb without charging, it does require root though.

@user1059432 2012-09-04 12:20:04

I have an Android 4.0.3 phone without root access so can't test any of this but let me point you to /sys/class/power_supply/battery/ which gives some info/control over charging issues. In particular there is charging_enabled which gives the current state (0 not charging, 1 charging) and may be writable on some phones?

$ adb shell
$ cat /sys/class/power_supply/battery/charging_enabled

There is also a file charger_control which sounds promising and is writable by root but I've found no documentation on it.

Someone has requested this feature as an enhancement on the google developer forum but so far without response:

@xoxol_89 2013-07-26 11:01:08

user1059432, yes. we can change value in /sys/class/power_supply/battery/charger_control to 0. so we have connecting via usb without charging.

@t0mm13b 2013-07-26 12:36:38

@xoxol_89 That is extremely dependent on what device and type of battery driver, not all of them work! Look at my project on github it only works specifically for the Zte Blade.

@Gohan 2014-11-10 13:02:10

[email protected]:/sys/class/power_supply $ ls ls ac max170xx_battery usb seems I can't do anything with my battery max170xx_battery

@Ikon 2017-09-22 13:44:28

On OnePlus 3 this path is exactly there and using the Automate app's superuser block on a rooted device I could use this trick not only to tell my battery level while charging but gracefully stop the device being overcharged. The icon will still show the charge symbol, but it is not doing it. The battery even starts to drop after a while.

@Weboide 2011-10-26 12:29:57

You can find an interesting article about phone batteries at

Basically, the more heat, the less lifetime your battery will have. My suggestion would be to charge it while the phone is shut down, that way there is no drain or load on the battery other than charging.

@Irfan 2012-05-21 10:27:49

This does not answer OP's question (see the title) at all.

@Weboide 2012-05-29 15:48:44

Actually, he's also asking if it is correct that the battery life can be affected by using it while charging, which increases the heat of the phone so reduces battery life. The article I posted talks about the relation between temperature and battery life.

@Irfan 2012-05-29 16:03:12

Oh, my bad. I didn't notice that. :) Well it would have been more apt to state that what you're posting is just "partial answer" etc.

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] How should I charge my phone ( avoid fast charging)?

2 Answered Questions

[SOLVED] Charging over USB can be harmful?

1 Answered Questions

[SOLVED] Will charging a phone with a different USB *cable* affect the battery life?

  • 2016-04-10 10:50:27
  • Matthew Lyte
  • 2521 View
  • 1 Score
  • 1 Answer
  • Tags:   usb battery charging

Sponsored Content