Workaround issue with latest version of RecyclerView which is overriding our custom accessibility delegate

-> Not the prettiest fix, but we only ever use the LauncherAccessibilityDelegate for BubbleTextViews,so anything else getting set here is incorrect. Stop-gap until we root cause the RV issue and decide whether there's a fix there, or a better way to ensure Launcher behaves correctly.

issue 129745295

Change-Id: I27cf79fda9edc2bebeda4728b776ab292caa141d
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 7085c60..1619e36 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -43,6 +43,7 @@
 import android.widget.TextView;
 
 import com.android.launcher3.Launcher.OnResumeCallback;
+import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
 import com.android.launcher3.dot.DotInfo;
 import com.android.launcher3.folder.FolderIcon;
 import com.android.launcher3.graphics.DrawableFactory;
@@ -227,6 +228,18 @@
         applyFromWorkspaceItem(info, false);
     }
 
+    @Override
+    public void setAccessibilityDelegate(AccessibilityDelegate delegate) {
+        if (delegate instanceof LauncherAccessibilityDelegate) {
+            super.setAccessibilityDelegate(delegate);
+        } else {
+            // NO-OP
+            // Workaround for b/129745295 where RecyclerView is setting our Accessibility
+            // delegate incorrectly. There are no cases when we shouldn't be using the
+            // LauncherAccessibilityDelegate for BubbleTextView.
+        }
+    }
+
     public void applyFromWorkspaceItem(WorkspaceItemInfo info, boolean promiseStateChanged) {
         applyIconAndLabel(info);
         setTag(info);