Fix VrFlinger handoff

In aosp/613510, hotplug processing was moved to main thread and deferred
the actual display devices creation to the next cycle of
SurfaceFlinger's main thread. This breaks UpdateVrFlinger logic, which
runs on the main thread and assumes all new display devices get created
synchronously during the handoff.

This CL fixes the issue by allowing synchronous calling
processDisplayHotplugEventsLocked() from onHotplugReceived() if and only
if the callback is called on main thread.

Bug: 72103899
Test: VrApp now renders fine
Change-Id: I2abd5d5861e0bb74419f12142f7f7c33190a022c
Merged-In: I2abd5d5861e0bb74419f12142f7f7c33190a022c
(cherry picked from commit ccfd682b5280fe638d4e0b4c7841c98aab298788)
1 file changed