Fix cutout race in shade header

when When the shade was moving between displays it was also receiving new insets. However, in ShadeHeaderController we were using ShadeDisplayRepository#displayId, which contains the id of the display the shade is currently at (a more appropriate name would be "committedDisplayId").

As the shade didn't finish transitioning to that display yet when receiving the insets callback, we were using the insetsProvider for the old display.

This resulted in always using the insets of the old display where the shade was at.

By using the pendingDisplayId instead we make sure insets for the correct shade display are received, even if the shade move is still in progress.

As a side note: the shade hader controller gets insets from both the view and the StatusBarContentInsetsProvider. This feels wrong, but it's also outside the scope of this bugfix.

Bug: 438406941
Test: ShadeHeaderControllerTest
Flag: NONE - bugfix
Change-Id: I4beec738247ec179f0518847bc40f29604b268c7
1 file changed