Android: API to control battery protection mode?

  • #1
Swamp Thing
Insights Author
991
713
My new Lenovo tablet has a "battery protection mode". This is useful for example when you want to leave it on charge almost permanently, in which case the protection mode will charge and discharge between 40% and 60% in order to maximize battery life.

Is there an API that can enable/disable this mode?

Screenshot_2022-06-25-07-59-26-516.jpeg
 
Technology news on Phys.org
  • #2
As far as I know, there is no public API for this. All Android APIs related to battery are read-only.

If your phone is rooted, then there are some Magisk modules that can do this. In addition, OEMs may have some hidden APIs that can do this, but that will be specific to each brand and not easily discoverable.

Different brands have different implementations of charge controller. Your device charges and discharges between 40 and 60%. Newer Samsung devices with OneUI can stop the charging at 85%, and restart it at around 83%. (My HP laptop stops charging at 80% and trickle charges thereafter.)
 
  • Like
Likes Swamp Thing and berkeman
  • #3
Swamp Thing said:
My new Lenovo tablet has a "battery protection mode". This is useful for example when you want to leave it on charge almost permanently, in which case the protection mode will charge and discharge between 40% and 60% in order to maximize battery life.

Is there an API that can enable/disable this mode?

View attachment 303294
Sounds like a new product opportunity to me. Design an external USB-C charging device that can query the charge state of the target device and adjust the charging profile delivered by that charging device. Might be a hit product -- I'd probably buy one or five... :smile:
 
  • Like
Likes anorlunda and Wrichik Basu
  • #4
berkeman said:
Sounds like a new product opportunity to me. Design an external USB-C charging device that can query the charge state of the target device and adjust the charging profile delivered by that charging device. Might be a hit product -- I'd probably buy one or five... :smile:
While searching on this topic, I found a suggestion that one can use if one is OK with an extra external device. You can use a WiFi controlled smart mains socket that can be commanded ON / OFF by an app running on your phone. Charge through that socket, and let the app do all the logic.
 
  • Informative
Likes Tom.G and berkeman

Similar threads

Replies
15
Views
2K
Replies
9
Views
6K
Replies
4
Views
2K
Replies
6
Views
2K
Replies
56
Views
52K
Replies
10
Views
3K
Replies
1
Views
3K
Back
Top