How to stop an android device from being charged programmatically?

后端 未结 9 646
醉酒成梦
醉酒成梦 2020-12-23 13:20

Is there an Android API for stop charging even though physically the charging is on?

相关标签:
9条回答
  • 2020-12-23 14:13

    Just to add to this. Samsung phones do not stop charging after 100%. As far as I'm aware they "trickle" charge past this point however they recommend you do not charge your phone past 100% for over 1 hour. Battery manufacturers like Anker also state the same so the idea of stopping the charge at 100% would be really useful. The risks of leaving the phone on charge are battery bloat and eventually cell rupture. I wasn't aware of this to start off with an killed my samsung battery within 3 months of owning the phone.

    To expand on the original question. I've noticed some kernels allow fast charging. If they are able to alter the charge rate up could we alter the charge rate down (trickle) to meet a desired finish time (when your morning alarm goes off)??

    0 讨论(0)
  • 2020-12-23 14:19

    Is there an Android API for stop charging even though physically the charging is on?

    AFAIK no.

    Justification:

    android.intent.action.BATTERY_CHANGED is a protected intent that can only be sent by the system. Therefore you cannot duplicate or override the functionality.

    0 讨论(0)
  • 2020-12-23 14:19

    I have installed a timer on the AC receptacle where I plug my Moto E's charger into. After guestimating how much time the battery needs to charge to about 85%, I set the timer. This is not my idea of a solution, but at least it keeps my phone from being charged to 100%, as I usually err on the short side when setting the timer.

    0 讨论(0)
提交回复
热议问题