4

For some reasons not related to the battery life, I need to disable the battery charging when a USB host is connected to my phone (a rooted Nexus 4). Taking a look around on the internet (link1, link2), it looks like I should modify a system file. I have found a series of interesting files located in /sys/class/power_supply/battery and /sys/class/power_supply/usb, that could be the right ones to be modified in order to achieve the usb charging disabling (e.g. /sys/class/power_supply/usb/present 0/1). Has anyone tried something like that? Which is the best way to modify those system files? Should I use the adb shell or another tool?

I tried the "root explore" app in order to modify those files, however when I modified a file (after changing its permissions), it was automatically kept back to its original value.

Community
  • 1
  • 1
STiLLeN
  • 293
  • 2
  • 4
  • 16
  • 1
    This question appears to be off-topic because it is not related to a programming problem. The question would be better asked on http://android.stackexchange.com – Boardy Oct 11 '13 at 11:34
  • Thanks, I'll post my question there as well. Anyway, if someone has an idea please share. – STiLLeN Oct 11 '13 at 12:20
  • Although file-like, those are not actual files, but sysfs nodes used for communicating with the kernel. Their behavior really depends on the kernel modules which implement them. – Chris Stratton Oct 11 '13 at 15:09
  • This means they are not editable in "standard ways" then? – STiLLeN Oct 11 '13 at 15:58

0 Answers0