Set initial value of enabledDisplay to DEFAULT_DISPLAY

It seems some classes using DisplayRepository ask for displays immediately, before the first update that populates it with the default display. This was not a problem before, as we were using SharedFlows and the collector was just suspended until the first emission was output. However, as we're using StateFlows now, collectors were taking the initial emptySet and misbehaving (this was happening in code related to screenshot).

This might generate a binder call on the main thread to get the default Display, but chances are this will hit caches. It's tricky to move this to the background thread without changing the API and without using SharedFlows

Bug: 345472038
Test: DisplayRepositoryTest
Flag: com.android.systemui.enable_efficient_display_repository
Change-Id: I48aeabace323f8d68aa6de8e8fa530fc7656e755
2 files changed