Commit Graph

2 Commits

Author SHA1 Message Date
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