Do not assume display is available when a task launches

The resize veil creates a SCVH as soon as a task launches to draw the
icon drawable early and once to be ready for any resize operation.

However, it cannot be assumed that the DisplayController will return a
non-null display if the task and display were both launched roughly at
the same time.

To avoid a NPE, this change checks whether the display is available and
if not attaches a listener to do the resize veil set up when it actually
appears.

Bug: 333442423
Test: atest WMShellUnitTests:ResizeVeil; resize veil works as usual;
atest CtsInputTestCases doesn't cause a crash

Change-Id: Id8efb265e1910144f92fee1144aa07afb9327056
4 files changed