Use the shade display instead of the focused one to open dialogs
When the focused display was different than the shade display, dialogs
were unexpectedly opening on the wrong display. This happened because
expanding the shade doesn't change the display id focus.
This is a workaround for the focused display not changing when the shade window is opened in a specific display.
While the behaviour is being clarified, this cl uses the shade display id to open all dialogs/launch activities related to the shade window.
Why was the focused display id used instead of the shade one? Because certain dialogs (e.g. internet dialog triggered from all apps QS tile after searching for "internet") are supposed to open in the focused display and are unrelated to the shade display. The choice was between providing 2 different contexes, or just using the focused display. The focused display ended up being used with the assumption it changed when the shade was expanded, but it currently doesn't. If it does, we should partially revert this to use the focused display id.
Fortunately an e2e caught this early in postsubmits.
The logic of `context` has been simplified as well.
Bug: 428281768
Bug: 428694180
Bug: 423929154
Flag: com.android.systemui.shade_window_goes_around
Test: OpenSettingsFromQuickSettings
Change-Id: I3485987d6a7bc31a5576637e758cb72114f25198
1 file changed