Optimize DisplayRepository to reduce lock contention
Despite all the calls to getDisplays() were going on in the background, they were often taking a lot of time, and ending up keeping a lock that was blocking other threads and processes.
This change reduces the binder calls to get displays to only one per addition.
Bug: 345472038
Bug: 344362341
Test: DisplayRepositoryTest
Flag: com.android.systemui.enable_efficient_display_repository
Change-Id: I77a463db42c5ae2c06d59f6bcef2f3f89fa05bef
2 files changed