From 8c878d61bb6724f4f69c577ae03ebba90bc262a2 Mon Sep 17 00:00:00 2001 From: Robert Horvath Date: Mon, 12 Apr 2021 16:51:56 +0200 Subject: Conditionally show bootanimation for quiescent boots Allow bootanimation to play if the boot is quiescent and the system property ro.bootanim.quiescent.enabled is set to true. This allows the bootanimation to become visible if the display is turned on during the bootanimation. If OEMs want this behavior and the device implements suppression of video/audio during quiescent boot, they can set the system property ro.bootanim.quiescent.enabled. Bug: 185118020 Test: PRODUCT_PRODUCT_PROPERTIES += ro.bootanim.quiescent.enabled=true adb reboot quiescent Spam `adb shell input keyevent POWER` during boot Test: Repeat the above test with the property set to 0 Change-Id: I54a4ad552704106ca06c4992fed4a2d501aa3fa5 --- cmds/bootanimation/BootAnimationUtil.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cmds/bootanimation/BootAnimationUtil.cpp') diff --git a/cmds/bootanimation/BootAnimationUtil.cpp b/cmds/bootanimation/BootAnimationUtil.cpp index 1e417e938359..4f56e5a88c4c 100644 --- a/cmds/bootanimation/BootAnimationUtil.cpp +++ b/cmds/bootanimation/BootAnimationUtil.cpp @@ -49,7 +49,14 @@ bool bootAnimationDisabled() { } property_get("ro.boot.quiescent", value, "0"); - return atoi(value) > 0; + if (atoi(value) > 0) { + // Only show the bootanimation for quiescent boots if this system property is set to enabled + if (!property_get_bool("ro.bootanim.quiescent.enabled", false)) { + return true; + } + } + + return false; } void waitForSurfaceFlinger() { -- cgit v1.2.3-59-g8ed1b