diff options
| author | 2024-03-13 01:46:29 +0000 | |
|---|---|---|
| committer | 2024-03-13 01:46:29 +0000 | |
| commit | 1055d17c036ab9f14030a2d7e50338a3f6478597 (patch) | |
| tree | 07090a6e02304976e02a9879d84d0fa79efbf9bc | |
| parent | 163fd0c613d3746c26af592c07a04042fa6ac36e (diff) | |
| parent | 28912453609aed85b7ba1c8dcac309908aae63e9 (diff) | |
Merge "Fix for accessibility focus in custom snackbar" into main
4 files changed, 19 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/DragToInteractView.kt b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/DragToInteractView.kt index 0ef3d200d1fa..a90d4b2b6061 100644 --- a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/DragToInteractView.kt +++ b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/DragToInteractView.kt @@ -118,6 +118,12 @@ class DragToInteractView(context: Context) : FrameLayout(context) { iconResId = R.drawable.pip_ic_close_white ) ) + + // Ensure this is unfocusable & uninteractable + isClickable = false + isFocusable = false + importantForAccessibility = IMPORTANT_FOR_ACCESSIBILITY_NO + // END DragToInteractView modification } diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuMessageView.java b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuMessageView.java index e57323b81490..35fe6b14ee28 100644 --- a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuMessageView.java +++ b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuMessageView.java @@ -74,6 +74,12 @@ class MenuMessageView extends LinearLayout implements addView(mTextView, Index.TEXT_VIEW, new LayoutParams(/* width= */ 0, WRAP_CONTENT, /* weight= */ 1)); addView(mUndoButton, Index.UNDO_BUTTON, new LayoutParams(WRAP_CONTENT, WRAP_CONTENT)); + + // The message box is not focusable, but will announce its contents when it appears. + // The textView and button are still interactable. + setClickable(false); + setFocusable(false); + setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_POLITE); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java index 577bbc0bd840..986391791b2c 100644 --- a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java +++ b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java @@ -101,6 +101,10 @@ class MenuView extends FrameLayout implements loadLayoutResources(); addView(mTargetFeaturesView); + + setClickable(false); + setFocusable(false); + setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuViewLayer.java b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuViewLayer.java index cd3b8a68fb48..983ec2adbe91 100644 --- a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuViewLayer.java +++ b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuViewLayer.java @@ -319,6 +319,9 @@ class MenuViewLayer extends FrameLayout implements if (Flags.floatingMenuAnimatedTuck()) { setClipChildren(true); } + setClickable(false); + setFocusable(false); + setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); } @Override |