Merge "Making talkback focus on the widget after the resize" into tm-qpr-dev am: 3ccbba3e9f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20447067
Change-Id: I2887f80b17c1e8fa1e40d22dd2061472341c7688
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
index dd47592..063b82e 100644
--- a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
+++ b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
@@ -1,5 +1,7 @@
package com.android.launcher3.accessibility;
+import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED;
+import static android.view.accessibility.AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS;
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_LONG_CLICK;
import static com.android.launcher3.LauncherState.NORMAL;
@@ -172,7 +174,11 @@
mContext.getDragLayer().getDescendantRectRelativeToSelf(host, pos);
ArrowPopup popup = OptionsPopupView.show(mContext, new RectF(pos), actions, false);
popup.requestFocus();
- popup.setOnCloseCallback(host::requestFocus);
+ popup.setOnCloseCallback(() -> {
+ host.requestFocus();
+ host.sendAccessibilityEvent(TYPE_VIEW_FOCUSED);
+ host.performAccessibilityAction(ACTION_ACCESSIBILITY_FOCUS, null);
+ });
return true;
} else if (action == DEEP_SHORTCUTS || action == SHORTCUTS_AND_NOTIFICATIONS) {
BubbleTextView btv = host instanceof BubbleTextView ? (BubbleTextView) host