Clear Accessibility Focus from icon after Shorcut Menu invoked
Similar to I2726504094af2abacf1c41089c7bcd4efb588099
Fixes: 267695526
Test: have talkback on
open all apps
open long press menu
ensure focus stays on pop up menu
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:cb582591b3861603eebd2e26ad94db1a49ff9a24)
Merged-In: I38f78df3855495c53a5ae8966e9a996e4679e95b
Change-Id: I38f78df3855495c53a5ae8966e9a996e4679e95b
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
index 243ed5c..0a72f36 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
@@ -1171,6 +1171,11 @@
}
@Override
+ public void tryClearAccessibilityFocus(View view) {
+ view.clearAccessibilityFocus();
+ }
+
+ @Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java
index 855983f..05a6452 100644
--- a/src/com/android/launcher3/BaseActivity.java
+++ b/src/com/android/launcher3/BaseActivity.java
@@ -29,6 +29,7 @@
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;
+import android.view.View;
import android.window.OnBackInvokedDispatcher;
import androidx.annotation.IntDef;
@@ -362,6 +363,12 @@
return (mForceInvisible & mask) != 0;
}
+ /**
+ * Attempts to clear accessibility focus on {@param view}.
+ */
+ public void tryClearAccessibilityFocus(View view) {
+ }
+
public interface MultiWindowModeChangedListener {
void onMultiWindowModeChanged(boolean isInMultiWindowMode);
}
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index 3f75ecc..1bd329e 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -238,6 +238,7 @@
deepShortcutCount,
popupDataProvider.getNotificationKeysForItem(item),
systemShortcuts);
+ launcher.tryClearAccessibilityFocus(icon);
}
launcher.refreshAndBindWidgetsForPackageUser(PackageUserKey.fromItemInfo(item));
container.requestFocus();