Restore decorFitsSystemWindows from preserved window

When activity is relaunching, the framework might reuse the DecorView
but create a new instance of PhoneWindow.

So PhoneWindow#mDecorFitsSystemWindows will be reset. And then
applyDecorFitsSystemWindows will be executed before
mDecorFitsSystemWindows is re-assigned. The window won't be attached
again, so correct value won't be applied again.

This CL restores decorFitsSystemWindows from the preserved window before
applying it.

Fix: 354130297
Bug: 309578419
Flag: com.android.window.flags.enforce_edge_to_edge
Test: Open a location in Weather which has a different theme from the
      main page. See if status bar is black.
Change-Id: I82b5450ba4044a6ef65e21d3cf65f679d1906a90
1 file changed