Add a null check in case the display is missing.

This is guarding null at last minute to avoid framework crash on a race
condition. If orientation sensor updates proposed rotation and primary
display is disconnected right after that, it's possible that framework
is handling display rotation before it knows primary display is gone,
and surface flinger returns null handle for BUILT_IN_DISPLAY_ID_MAIN.

Bug: 75273516
Test: go/wm-smoke on walleye, with necessary modifications to adapt to
new Pixel Launcher.
Change-Id: I98173a74548f81a23cd1b8e7ad52bd45ee9ef9fb
1 file changed