Commit Graph

3 Commits

Author SHA1 Message Date
Jack Wu
282b3e3c9b healthd: fix the over estimated battery capacity
Overwrite the gauge capacity with the backup one if the gauge capacity
reset to nominal.

Test: fake /sys/class/power_supply/bms/charge_full to nominal and
      check if it can be restored from /persist/battery/qcom_charge_full
Bug: 158838006
Signed-off-by: Jack Wu <wjack@google.com>
Change-Id: I4b85dd5e0c3ca929044aa8776294b841db7214e1
2020-06-16 07:09:40 +00:00
Thierry Strudel
ed713cf656 health: fix learned capacity backup/restore
The code was only allowing the Learned Capacity to decrease while
QCOM FG learned capacity may actually go up for some reasons.
Ensure we use the FG learned capacity on update and always restore
the saved one on boot.

Bug: 109734601
Change-Id: I21b559c27a5298e8eea39ec502e4f1d6f7a4b053
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2018-06-21 08:12:02 +00:00
Jack Wu
2fa48ee4fe battery learned capacity: backup/restore to/from persist data
Test:
    - delete file /persist/battery/qcom_charge_full
    - adb logcat to check code flow related health@2.0
    - adb bugreport
    - no "avc: denied" on health vendor service
    - check learned capacity in both
      /sys/class/power_supply/bms/charge_full
      /persist/battery/qcom_charge_full
      -- decrease /sys/class/power_supply/bms/charge_full
         to check backup to /persist/battery/qcom_charge_full
      -- increase /sys/class/power_supply/bms/charge_full
         to check restore from /persist/battery/qcom_charge_full
         (simluate the reset condition)

Bug: 78883741
Change-Id: Ib17bc0938d3a4b78376140a8a1008b4fc82220af
Signed-off-by: Jack Wu <wjack@google.com>
2018-05-10 09:13:50 -07:00