battery cycle counts: backup/restore + update dumpstate

Tests:
  - pts-tradefed run pts -a arm64-v8a -m PtsHardwareInfoHostTestCases
  - adb bugreport
  - no "avc: denied" on health vendor service
  - cycle count stored in /persist/battery/qcom_cycle_counts_bins

Bug: 72776338
Bug: 77498107
Change-Id: Ia1a58441fff511c60278b5d97806655c34aec610
Signed-off-by: Thierry Strudel <tstrudel@google.com>
This commit is contained in:
Thierry Strudel
2018-04-03 17:22:55 -07:00
parent e08dbcb6fe
commit fa1279bd6b
12 changed files with 246 additions and 8 deletions

View File

@@ -187,6 +187,10 @@ on fs
chmod 0770 /persist/rfs/apq
chmod 0770 /persist/rfs/apq/gnss
chmod 0770 /persist/hlos_rfs
# for android.hardware.health@2.0-service.marlin cycle count backup
mkdir /persist/battery 0700 system system
restorecon_recursive /persist
# Start HW service manager early
@@ -425,6 +429,11 @@ on early-boot
chown system system /sys/class/leds/blue/rgb_start
chown system system /sys/class/graphics/fb0/msm_fb_persist_mode
# dumpstate needs to read, vendor.health-hal needs to be able to RW
chown system system /sys/devices/soc/800f000.qcom,spmi/spmi-0/spmi0-02/800f000.qcom,spmi:qcom,pmi8998@2:qpnp,fg/cycle_counts_bins
# HardwareInfo needs to be able to read CC bins
chmod 644 /sys/devices/soc/800f000.qcom,spmi/spmi-0/spmi0-02/800f000.qcom,spmi:qcom,pmi8998@2:qpnp,fg/cycle_counts_bins
on boot
mkdir /dev/socket/qmux_radio 0770 radio radio
chmod 2770 /dev/socket/qmux_radio