Merge "Fix Talkback focus for call log action views." into mnc-dev
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 5c57c18..cbe5b29 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -164,10 +164,15 @@
*/
private AccessibilityDelegate mAccessibilityDelegate = new AccessibilityDelegate() {
@Override
- public boolean onRequestSendAccessibilityEvent(ViewGroup host, View child,
- AccessibilityEvent event) {
+ public boolean onRequestSendAccessibilityEvent(
+ ViewGroup host, View child, AccessibilityEvent event) {
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) {
- expandViewHolderActions((CallLogListItemViewHolder) host.getTag());
+ // Only expand if actions are not already expanded, because triggering the expand
+ // function on clicks causes the action views to lose the focus indicator.
+ CallLogListItemViewHolder viewHolder = (CallLogListItemViewHolder) host.getTag();
+ if (mCurrentlyExpandedPosition != viewHolder.getAdapterPosition()) {
+ expandViewHolderActions((CallLogListItemViewHolder) host.getTag());
+ }
}
return super.onRequestSendAccessibilityEvent(host, child, event);
}