From 4363e8c3a781df3569ed02983e74257cfd3b910b Mon Sep 17 00:00:00 2001 From: Jack Wu Date: Wed, 10 Jul 2024 14:47:14 +0800 Subject: [PATCH] charger: fix show qustion mark when start to draw UI skip drawing UI if battery status is not ready. Bug: 343093322 Test: confirm offmode charge UI behavior Change-Id: Ic5ed4577502bea22f693b7ec0b577dc25ba24712 Signed-off-by: Jack Wu --- healthd/healthd_mode_charger.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp index 26af13b31..54b469be3 100644 --- a/healthd/healthd_mode_charger.cpp +++ b/healthd/healthd_mode_charger.cpp @@ -306,8 +306,8 @@ void Charger::UpdateScreenState(int64_t now) { if (!batt_anim_.run || now < next_screen_transition_) return; - // If battery level is not ready, keep checking in the defined time - if (health_info_.battery_level == 0 && health_info_.battery_status == BatteryStatus::UNKNOWN) { + // If battery status is not ready, keep checking in the defined time + if (health_info_.battery_status == BatteryStatus::UNKNOWN) { if (wait_batt_level_timestamp_ == 0) { // Set max delay time and skip drawing screen wait_batt_level_timestamp_ = now + MAX_BATT_LEVEL_WAIT_TIME; @@ -317,7 +317,7 @@ void Charger::UpdateScreenState(int64_t now) { // Do nothing, keep waiting return; } - // If timeout and battery level is still not ready, draw unknown battery + // If timeout and battery status is still not ready, draw unknown battery } if (healthd_draw_ == nullptr) return;