aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Wu <wjack@google.com>2018-06-28 15:47:47 +0800
committerAleX Pelosi <apelosi@google.com>2018-07-28 17:22:25 +0000
commit6d15b70f97393b7e60173970d76275a7e23a8764 (patch)
treed4bc53d1bba43d0b3fc1ecfbc7d9d14290ddc6e2
parent5143df1b4c046614e699e8e22f5b23e75a1ea1dc (diff)
battery: fix retail mode not workingandroid-9.0.0_r0.12
Charging was not disabled in retail mode. The charging disable path was not executed because the priority of charger present check was higher. Separate the check of charger in/out and charging enable/disable to fix this. Bug: 110489408 Change-Id: If0180621903ec20a969cb22359e03a76eb3bd8aa Signed-off-by: Jack Wu <wjack@google.com>
-rw-r--r--drivers/power/htc_battery.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/power/htc_battery.c b/drivers/power/htc_battery.c
index 21e9d97c8996..d91d5387dc92 100644
--- a/drivers/power/htc_battery.c
+++ b/drivers/power/htc_battery.c
@@ -628,7 +628,9 @@ static void batt_worker(struct work_struct *work)
set_batt_psy_property(
POWER_SUPPLY_PROP_INPUT_SUSPEND,
!pwrsrc_enabled);
- } else if (charging_enabled != gs_prev_charging_enabled) {
+ }
+
+ if (charging_enabled != gs_prev_charging_enabled) {
BATT_EMBEDDED("set charging_enable(%d)",
charging_enabled);
set_batt_psy_property(