GrapheneOS / os-issue-tracker

Issue tracker for GrapheneOS Android Open Source Project hardening work. Standalone projects like Auditor, AttestationServer and hardened_malloc have their own dedicated trackers.
https://grapheneos.org/
352 stars 19 forks source link

Battery charge limits (e.g. max 85%) to improve battery health over time #3213

Open sandreas opened 7 months ago

sandreas commented 7 months ago

Usually, the battery of my phone charges until it hits 100% charging level.

I would love to see a feature to limit the charging level to e.g. 85%. This would improve battery health over time. This setting is also present in Lenovo Notebooks.

snrkl commented 6 months ago

FWIW the pixel tablet restricts charging to ~80% when on the provided dock..

sandreas commented 6 months ago

@thestinger Is there any way to vote for this feature? I wonder if thumbsup clicks are recognized in any way...

thestinger commented 6 months ago

You can use the thumbs up reaction to express support for it. Please don't use comments for it. Doesn't mean it will get prioritized.

aureq commented 6 months ago

To add a little more here... It appears there's a Magisk module (link) that already do that as well as a front-end app (link). The main issue though is this solution require root access to the device to control the android kernel behavior.

To be confirmed, but it feels like this would require a tight integration into GrapheneOS as exposing root is a no.

sandreas commented 6 months ago

@aureq

Yeah there is a reddit post claiming, that the indicator totally is a lie and 100% actually represents 80%-90% charging level to optimize the battery life and 80% would be somewhere around 64% in reality.

However, although this sounds plausible, I would love to hear that from a developer posting a code reference - I did not find something reliable anywhere.

eugenesan commented 5 months ago

First, that feature is an absolute and hard requirement for devices that expected to last 3+ years! I can understand why Google won't implement it as a manual option (dumb users, AI propagation, short device upgrade cycles etc) but I can't figure why it is not a standard option on GrapheneOS especially when configuring battery charging limits on Tensor SOCs is as simple as:

echo 80 > /sys/devices/platform/google,charger/charge_start_level
echo 85 > /sys/devices/platform/google,charger/charge_stop_level

And this is exactly how Pixel's "AI" does it to optimize the battery

Unfortunately, that requires root access or integration in the OS. It should pretty trivial to do and I hope there will enough pressure on Graphene to do that since that's the only thing keeping me from using GrapheneOS.

Regarding "fake" charge levels, it's incorrect. Android's "charge control" will inform you about if and when it does the "optimization" and you'll continue to see the actual battery state of charge.

uberhalit commented 3 months ago

Any news on this? My phone gets held hostage at 100% for hours by android auto whenever I do a road trip.

matchboxbananasynergy commented 2 months ago

It's possible that Android 15 will include this in AOSP:

https://www.androidauthority.com/google-pixel-manual-charge-limit-3462210/

sandreas commented 2 months ago

It's possible that Android 15 will include this in AOSP:

Looks like there is no slider or something, just the fixed value of 80%. Good but still a bit disappointing, because on my (older) device 80% probably won't last the whole day. I had hoped for something custom like 85% or 90% to be able to have a value between 10% to 90%... well no reason to complain tough. Great news.