summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Lee <stayfan@google.com>2022-04-11 14:29:29 -0700
committerStephane Lee <stayfan@google.com>2022-04-11 14:29:29 -0700
commit7830e5aea6a5edd2f95951b73fe13e96361c8b07 (patch)
tree3b4da2db2391b5de8a4a6c4cf037948e4679c37a
parent284908a168a03cd0e014bdc9f71250965e7a94cf (diff)
downloadredbull-7830e5aea6a5edd2f95951b73fe13e96361c8b07.tar.gz
Fix Adaptive Charging/Google Battery HAL sysfs node permissions
Bug: 227302543 Test: Ensure that ls -Al /sys/class/power_supply/battery/charge_deadline is system/system Change-Id: I16344faf68031f5237c67b2918cb26ab974f4237
-rw-r--r--init.hardware.rc40
1 files changed, 9 insertions, 31 deletions
diff --git a/init.hardware.rc b/init.hardware.rc
index a35eb36f..75de40ac 100644
--- a/init.hardware.rc
+++ b/init.hardware.rc
@@ -142,41 +142,10 @@ on init && property:vendor.skip.init=0
# Property used by NFC for sku specific configurations
setprop ro.boot.product.hardware.sku ${ro.boot.hardware.sku}
- # Battery Defender
- chown system system /sys/devices/platform/soc/soc:google,charger/charge_stop_level
- chown system system /sys/devices/platform/soc/soc:google,charger/charge_start_level
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_drainto_soc
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_recharge_soc
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_recharge_voltage
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_abs_temp
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_soc
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_temp
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_time
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_trigger_temp
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_trigger_time
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_trigger_voltage
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_temp_enable
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_temp_dry_run
- chown system system /sys/devices/platform/soc/soc:google,charger/bd_clear
- chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/aacr_state
- chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/aacr_cycle_max
- chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/aacr_cycle_grace
- chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_trickle_enable
- chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_trickle_recharge_soc
- chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_trickle_cnt
- chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_trickle_dry_run
- chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_trickle_reset_sec
- chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_clear
- chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/health_safety_margin
- chown system system /sys/class/power_supply/wireless/device/mitigate_threshold
-
# report max frequency to unity tasks.
write /proc/sys/kernel/sched_lib_name "UnityMain,libunity.so"
write /proc/sys/kernel/sched_lib_mask_force 255
- # Charge stats (write 0)
- chown system system /sys/class/power_supply/battery/charge_stats
-
# NFC streset tool name
setprop persist.vendor.nfc.streset libstreset
setprop persist.vendor.se.streset libstreset
@@ -442,6 +411,15 @@ on early-boot
# FG cycle count read from dumpstate + backup restore from health HAL (and pixelstats)
chown system system /sys/class/power_supply/maxfg/cycle_counts_bins
+ # Battery Defender
+ chown system system /sys/devices/platform/soc/soc:google,charger/charge_stop_level
+ chown system system /sys/devices/platform/soc/soc:google,charger/charge_start_level
+ chown system system /sys/devices/platform/soc/soc:google,charger/bd_clear
+ chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_clear
+
+ # Charge stats (write 0)
+ chown system system /sys/class/power_supply/battery/charge_stats
+
# Permission for battery eeprom
chown system system /sys/devices/platform/soc/98c000.i2c/i2c-1/1-0050/1-00500/nvmem
chmod 0640 /sys/devices/platform/soc/98c000.i2c/i2c-1/1-0050/1-00500/nvmem