From f87046619c71953da0e0c2f5a0abdecd8e9f7160 Mon Sep 17 00:00:00 2001 From: vadimt Date: Tue, 5 Feb 2019 10:25:22 -0800 Subject: [PATCH] Disable double-tap accessibility action for a widget cell Before this CL, the cell had 3 announced actions: 1. Add to home screen (a custom action) 2. "Double-tap to activate" - performing this action instructed the user to use action #3 3. "Double-tap and hold for long press" - starts dragging the widget. Bug: 116018969 Test: Manual Change-Id: Ie2378ccb13d182a2558f70f7250055bf86c5e5f6 --- src/com/android/launcher3/widget/WidgetCell.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/android/launcher3/widget/WidgetCell.java b/src/com/android/launcher3/widget/WidgetCell.java index 66af43aebc..dc4af8caf9 100644 --- a/src/com/android/launcher3/widget/WidgetCell.java +++ b/src/com/android/launcher3/widget/WidgetCell.java @@ -26,6 +26,7 @@ import android.view.View; import android.view.View.OnLayoutChangeListener; import android.view.ViewGroup; import android.view.ViewPropertyAnimator; +import android.view.accessibility.AccessibilityNodeInfo; import android.widget.LinearLayout; import android.widget.TextView; @@ -236,4 +237,10 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { public CharSequence getAccessibilityClassName() { return WidgetCell.class.getName(); } + + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + info.removeAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_CLICK); + } }