Repository: flutter
Issue: [Android, SystemChrome, FlutterActivity] Status bar becomes semi translucent when using a pre-warmed Flutter engine
Labels: platform-android,engine,a: existing-apps,a: layout,has reproducible steps,P2,found in release: 3.3,found in release: 3.5,team-android,triaged-android

## Steps to Reproduce

1. Create an Android app
2. Add a Flutter module 
3. Set status bar color in flutter using AppBar systemOverlayStyle property
4. Pre warm flutter engine
5. Launch FlutterActivity. The statusbar is colored properly
6. Click back
7. Launch FlutterActivity one more time
8. Status bar is darker. Looks like it's semi translucent 

Without pre-warming everything works fine

**Expected results:** <!-- what did you want to see? -->

Status bar color is consistent between activity launches. 
Here is an example of how it works without pre-warmed Flutter engine 

[device-2022-10-18-124454.webm](https://user-images.githubusercontent.com/32295746/196397885-45f439a7-7d49-4121-9b69-08cb0dace1f7.webm)

**Actual results:** <!-- what did you see? -->

With pre-warmed Flutter engine the activity launches much faster, but on the second launch the status bar color changes 

[device-2022-10-18-124612.webm](https://user-images.githubusercontent.com/32295746/196398055-e678c3a6-ff1c-412e-8a0d-531bc90f83fc.webm)

<details><summary>Android code</summary>
<p>

```kotlin
   class MainActivity : AppCompatActivity() {

    private lateinit var binding: ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        prewarmFlutter()

        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)

        setSupportActionBar(binding.toolbar)

        binding.fab.setOnClickListener {
            startActivity(
//                Without a pre-cached Flutter engine everything works properly, but really slow
//                FlutterActivity.createDefaultIntent(this)

//                When adding a pre-cached engine,
//                status bar color becomes darker on a second Flutter activity launch
                FlutterActivity.withCachedEngine("my_engine_id").build(this)
            )
        }
    }

    private fun prewarmFlutter() {
        val flutterEngine = FlutterEngine(this)

        flutterEngine.dartExecutor.executeDartEntrypoint(
            DartExecutor.DartEntrypoint.createDefault()
        )

        FlutterEngineCache
            .getInstance()
            .put("my_engine_id", flutterEngine)
    }

}
```

</p>
</details>

<details><summary>Flutter code</summary>
<p>

```dart
   void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.red,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

const purple = Color(0xFF6200EE);

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: purple,
        title: Text(widget.title),
        systemOverlayStyle: const SystemUiOverlayStyle(statusBarColor: purple),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: const <Widget>[
            Text(
              'Flutter screen',
            ),
          ],
        ),
      ),
    );
  }
}
```
</p>
</details>