Make an input consumer for bubble bar

Instead of unstashing bubble bar in TaskbarUnstashInputConsumer
handle it in its own input consumer instead. This is a nicer
separation of concerns and simplifies the logic in both places.

Additionally, this fixes issues where swiping up the bubble bar
handle might initiate / be handled by gesture nav (or all apps) when
really any events originating on bubble UI should be managed by
bubbles instead.

Adds some mostly mock'd tests to check that the static method used
to indicate if bubbles should take the event or not works correctly.

Flag: com.android.wm.shell.enable_bubble_bar
Test: manual - test swipe up on bubble bar handle in an app
             - test swipe up on bubble bar on home - it should
               open & all apps / launcher transition shouldn't happen
             - longpress to drag bubbles around on home and overview,
               try the collapsed bar & individual bubbles in the
               expanded bar
             - test dragging on the bubble bar after it's revealed
               in an app
Test: atest BubbleBarInputConsumerTest
Bug: 345488529
Change-Id: I964d213d71de15e4350cff5202dfb9343de1af14
This commit is contained in:
Mady Mellor
2024-08-15 16:03:07 -07:00
parent d22a0b84cb
commit 788a6ebb74
8 changed files with 345 additions and 91 deletions
@@ -501,6 +501,15 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
return enableTinyTaskbar() && mDeviceProfile.isPhone && mDeviceProfile.isTaskbarPresent;
}
/**
* Returns {@code true} iff bubble bar is enabled (but not necessarily visible /
* containing bubbles).
*/
@Override
public boolean isBubbleBarEnabled() {
return getBubbleControllers() != null && BubbleBarController.isBubbleBarEnabled();
}
/**
* Returns if software keyboard is docked or input toolbar is placed at the taskbar area
*/