From ced3e0d1e58904e7cdcee0da9a706a94cb9c65d0 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 14 Aug 2019 16:20:44 -0700 Subject: [PATCH] Initialize the engine in the running state to match the animator's default state (flutter/engine#11011) The engine's activity_running flag tracks whether the app is in the paused or running lifecycle state. The engine had been defaulting activity_running to false (meaning paused). But the animator had been defaulting its paused flag to false, which allowed frames to render at startup. If the engine loses and regains its surface, then frames would stop rendering because activity_running is false (even though frames had been rendering when the engine initially acquired its surface). This change puts the engine and the animator into a consistent state at startup. Frames will continue to render until the embedder sends a lifecycle message that will pause both the engine and the animator. See https://github.com/flutter/flutter/issues/32624 --- engine/src/flutter/shell/common/engine.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/common/engine.cc b/engine/src/flutter/shell/common/engine.cc index ad8237862c..24fe77a1df 100644 --- a/engine/src/flutter/shell/common/engine.cc +++ b/engine/src/flutter/shell/common/engine.cc @@ -46,7 +46,7 @@ Engine::Engine(Delegate& delegate, : delegate_(delegate), settings_(std::move(settings)), animator_(std::move(animator)), - activity_running_(false), + activity_running_(true), have_surface_(false), image_decoder_(task_runners, vm.GetConcurrentWorkerTaskRunner(),