Include bubble bar location in taskbar announcement

When bubble bar has bubbles, it will be expanded together with taskbar.
Include information about bubble bar appearing together with the taskbar
announcement. During expand include the location of the bubble bar,
whether it is on the left or right.

Bug: 344675357
Flag: com.android.wm.shell.enable_bubble_bar
Test: manual, enable talkback and check that taskbar expand announcement
  includes information about bubble bar, check that when bar is on left,
  announcement includes left and bar is right, announcement says right
Change-Id: I116ed531fe7032940478451508b37f4fd0bc98ff
This commit is contained in:
Ats Jenk
2024-07-24 13:39:36 -07:00
parent 354d367c47
commit 4e4b8a8402
3 changed files with 51 additions and 4 deletions
@@ -23,8 +23,12 @@ import android.view.InputDevice;
import android.view.MotionEvent;
import android.view.View;
import androidx.annotation.Nullable;
import com.android.internal.jank.Cuj;
import com.android.launcher3.taskbar.bubbles.BubbleBarViewController;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
import com.android.wm.shell.common.bubbles.BubbleBarLocation;
/**
* Callbacks for {@link TaskbarView} to interact with its controller.
@@ -104,4 +108,18 @@ public class TaskbarViewCallbacks {
mControllers.taskbarScrimViewController.onTaskbarVisibilityChanged(
mTaskbarView.getVisibility());
}
/**
* Get current location of bubble bar, if it is visible.
* Returns {@code null} if bubble bar is not shown.
*/
@Nullable
public BubbleBarLocation getBubbleBarLocationIfVisible() {
BubbleBarViewController bubbleBarViewController =
mControllers.bubbleControllers.map(c -> c.bubbleBarViewController).orElse(null);
if (bubbleBarViewController != null && bubbleBarViewController.isBubbleBarVisible()) {
return bubbleBarViewController.getBubbleBarLocation();
}
return null;
}
}