Skip to content

Commit 9bc2519

Browse files
author
Paz Zcharya
committed
SF: Merge properties that skip boot animation
The flag debug.sf.nobootanimation causes the bootanim to exit early and not show an animation. When that flag is set, launching bootanim is pointless, but it slows down boot on average by about 800 ms on some devices [1]. Quick analysis showed that loading bootanim requires reading 80 MB of read-only memory [1], which is probably the reason behind the slowdown during boot. Optimize that by not launching bootanim at all when debug.sf.nobootanimation is set, similar to the behavior when debug.sf.boot_animation is false. References: [1] Brya boottime: bootanim takes ~1.5s, b/373711392 Bug: 324366212 Bug: 373711392 Test: Test all 4 combinations of setprop debug.sf.boot_animation {false,<null>} setprop debug.sf.nobootanimation {1, <null>} Flag: EXEMPT sysprop alias Change-Id: I5599072c14008ae67ab8aec4057bda953ac5b978 Signed-off-by: Paz Zcharya <pazz@google.com>
1 parent 19a57c0 commit 9bc2519

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,8 @@ void SurfaceFlinger::init() FTL_FAKE_GUARD(kMainThreadContext) {
10701070
void SurfaceFlinger::initBootProperties() {
10711071
property_set("service.sf.present_timestamp", mHasReliablePresentFences ? "1" : "0");
10721072

1073-
if (base::GetBoolProperty("debug.sf.boot_animation"s, true)) {
1073+
if (base::GetBoolProperty("debug.sf.boot_animation"s, true) &&
1074+
(base::GetIntProperty("debug.sf.nobootanimation"s, 0) == 0)) {
10741075
// Reset and (if needed) start BootAnimation.
10751076
property_set("service.bootanim.exit", "0");
10761077
property_set("service.bootanim.progress", "0");

0 commit comments

Comments
 (0)