diff options
author | Qi Wang <wangqi@google.com> | 2016-02-29 11:45:01 -0800 |
---|---|---|
committer | Qi Wang <wangqi@google.com> | 2016-02-29 18:47:47 -0800 |
commit | e1c196e04154815e2fb55801af73beb9fb2aa324 (patch) | |
tree | d7df7c75b0304c55fad2c04478c594ecb65989ab /InCallUI/src/com/android/incallui/CallCardFragment.java | |
parent | 9cff658da23dc80786650fb0203ae4566839f18d (diff) |
Accessibility: announce the active call after switching calls.
Bug: 24200862
Change-Id: I102a9c8406984a9dd4cfd8b91ec77254aa984dd5
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallCardFragment.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardFragment.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 9ba4a2b70..785d3d3aa 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -1124,10 +1124,19 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr public void dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { if (event.getEventType() == AccessibilityEvent.TYPE_ANNOUNCEMENT) { - dispatchPopulateAccessibilityEvent(event, mCallStateLabel); - dispatchPopulateAccessibilityEvent(event, mPrimaryName); - dispatchPopulateAccessibilityEvent(event, mCallTypeLabel); - dispatchPopulateAccessibilityEvent(event, mPhoneNumber); + // Indicate this call is in active if no label is provided. The label is empty when + // the call is in active, not in other status such as onhold or dialing etc. + if (!mCallStateLabel.isShown() || TextUtils.isEmpty(mCallStateLabel.getText())) { + event.getText().add( + TextUtils.expandTemplate( + getResources().getText(R.string.accessibility_call_is_active), + mPrimaryName.getText())); + } else { + dispatchPopulateAccessibilityEvent(event, mCallStateLabel); + dispatchPopulateAccessibilityEvent(event, mPrimaryName); + dispatchPopulateAccessibilityEvent(event, mCallTypeLabel); + dispatchPopulateAccessibilityEvent(event, mPhoneNumber); + } return; } dispatchPopulateAccessibilityEvent(event, mCallStateLabel); |