Android9关机充电时显示电量

Android9 高通 8953

 bootable/bootloader/lk/app/aboot/aboot.c | 3 +--
 system/core/healthd/healthd_draw.cpp     | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bootable/bootloader/lk/app/aboot/aboot.c b/bootable/bootloader/lk/app/aboot/aboot.c
index 10efe5f..1168407 100644
--- a/bootable/bootloader/lk/app/aboot/aboot.c
+++ b/bootable/bootloader/lk/app/aboot/aboot.c
@@ -534,8 +534,7 @@ unsigned char *update_cmdline(const char * cmdline)
 		cmdline_len += strlen(loglevel);
 	} else if (boot_reason_alarm) {
 		cmdline_len += strlen(alarmboot_cmdline);
-	} else if ((target_build_variant_user() || device.charger_screen_enabled)
-			&& target_pause_for_battery_charge() && !boot_into_recovery) {
+	} else if (target_pause_for_battery_charge() && !boot_into_recovery) {
 		pause_at_bootup = 1;
 		cmdline_len += strlen(battchg_pause);
 	}
diff --git a/system/core/healthd/healthd_draw.cpp b/system/core/healthd/healthd_draw.cpp
index ea3d991..466b0f9 100644
--- a/system/core/healthd/healthd_draw.cpp
+++ b/system/core/healthd/healthd_draw.cpp
@@ -158,6 +158,9 @@ void HealthdDraw::draw_percent(const animation* anim) {
   const animation::text_field& field = anim->text_percent;
   if (field.font == nullptr || field.font->char_width == 0 ||
       field.font->char_height == 0) {
+    std::string str_level = base::StringPrintf("%d%%", cur_level);
+    gr_color(0xa4, 0xc6, 0x39, 255);
+    draw_text(gr_sys_font(), -1, -1, str_level.c_str());
     return;
   }
 

发布了18 篇原创文章 · 获赞 6 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_37207639/article/details/102501287