From d43ec47f3b52667fb00978db4e119c2355008659 Mon Sep 17 00:00:00 2001 From: "Hannah.Hsu" Date: Sun, 25 Sep 2022 14:42:09 +0800 Subject: Fix doing silent update,power cut/restoration,screen is turned on [Description] 1. In the current code, when tv enter recovery mode, it will write "boot-recovery" into the BCB command field by default. This is a protection mechanism to ensure that tv can re-enter recovery mode continues OTA upgrade after power cut/power restoration. So, when re-enter recovery mode, since there is no "quiescent" in the boot parameters, the screen will turn on. 2. And we hope the screen will be turned off when tv re-enter recovery mode to continue OTA upgrade. 3. We made the following modify: In reocvery mode,According to GetBoolProperty "ro.boot.quiescent"to determine whether it is a quiescent boot this time,and then write "boot-recovery, quiescent" or"boot-recovery" accordingly. [Test Report] 1.boot up ok. 2.silent update ok. (the screen is turned off when interrupting/ resume or complete the upgrade) 3.OTA update ok. (the screen is turned on when interrupting/ resume or complete the upgrade) Change-Id: Ic68898f1a8e9ab176556ee2b61efec4d8d5d36e2 --- bootloader_message/bootloader_message.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp index 1ea56cd4e..0a713eed5 100644 --- a/bootloader_message/bootloader_message.cpp +++ b/bootloader_message/bootloader_message.cpp @@ -209,7 +209,11 @@ bool update_bootloader_message_in_struct(bootloader_message* boot, memset(boot->command, 0, sizeof(boot->command)); memset(boot->recovery, 0, sizeof(boot->recovery)); - strlcpy(boot->command, "boot-recovery", sizeof(boot->command)); + if (android::base::GetBoolProperty("ro.boot.quiescent", false)) { + strlcpy(boot->command, "boot-recovery,quiescent", sizeof(boot->command)); + } else { + strlcpy(boot->command, "boot-recovery", sizeof(boot->command)); + } std::string recovery = "recovery\n"; for (const auto& s : options) { -- cgit v1.2.3