From d43724d0b300c8fa706cdd61cf7759af2895d228 Mon Sep 17 00:00:00 2001 From: Stephane Lee Date: Mon, 10 Feb 2020 15:16:11 -0800 Subject: [PATCH] Initialize key structure to zero in charger This is necessary because the key callback may not be called before the states are checked. Bug: 149107347 Test: Ensure charger does not reboot Change-Id: I08d9e4b4046768eb0c0ca6171a2e5b7e5409d073 --- healthd/healthd_mode_charger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/healthd/healthd_mode_charger.h b/healthd/healthd_mode_charger.h index 370ca8694..6e569ee54 100644 --- a/healthd/healthd_mode_charger.h +++ b/healthd/healthd_mode_charger.h @@ -72,7 +72,7 @@ class Charger : public ::android::hardware::health::V2_1::implementation::HalHea int64_t next_pwr_check_ = 0; int64_t wait_batt_level_timestamp_ = 0; - key_state keys_[KEY_MAX + 1]; + key_state keys_[KEY_MAX + 1] = {}; animation batt_anim_; GRSurface* surf_unknown_ = nullptr;