diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml index 98a27839d2..3e252e120b 100644 --- a/quickstep/res/values/strings.xml +++ b/quickstep/res/values/strings.xml @@ -299,10 +299,16 @@ Quick Settings Taskbar - + Taskbar shown - + + Taskbar & bubbles left shown + + Taskbar & bubbles right shown + Taskbar hidden + + Taskbar & bubbles hidden Navigation bar diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java index c42d6c6c1c..e58069a7e4 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java @@ -72,6 +72,7 @@ import com.android.quickstep.util.AssistStateManager; import com.android.quickstep.util.DesktopTask; import com.android.quickstep.util.GroupTask; import com.android.systemui.shared.recents.model.Task; +import com.android.wm.shell.common.bubbles.BubbleBarLocation; import java.util.List; import java.util.function.Predicate; @@ -246,12 +247,34 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar @Override public boolean performAccessibilityActionInternal(int action, Bundle arguments) { if (action == AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS) { - announceForAccessibility(mContext.getString(R.string.taskbar_a11y_shown_title)); + announceTaskbarShown(); } else if (action == AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS) { - announceForAccessibility(mContext.getString(R.string.taskbar_a11y_hidden_title)); + announceTaskbarHidden(); } return super.performAccessibilityActionInternal(action, arguments); + } + private void announceTaskbarShown() { + BubbleBarLocation bubbleBarLocation = mControllerCallbacks.getBubbleBarLocationIfVisible(); + if (bubbleBarLocation == null) { + announceForAccessibility(mContext.getString(R.string.taskbar_a11y_shown_title)); + } else if (bubbleBarLocation.isOnLeft(isLayoutRtl())) { + announceForAccessibility( + mContext.getString(R.string.taskbar_a11y_shown_with_bubbles_left_title)); + } else { + announceForAccessibility( + mContext.getString(R.string.taskbar_a11y_shown_with_bubbles_right_title)); + } + } + + private void announceTaskbarHidden() { + BubbleBarLocation bubbleBarLocation = mControllerCallbacks.getBubbleBarLocationIfVisible(); + if (bubbleBarLocation == null) { + announceForAccessibility(mContext.getString(R.string.taskbar_a11y_hidden_title)); + } else { + announceForAccessibility( + mContext.getString(R.string.taskbar_a11y_hidden_with_bubbles_title)); + } } protected void announceAccessibilityChanges() { diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java index 3c646cb7fa..e6cac2f9db 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java @@ -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; + } }